/* ============================================================
   Atlantis Assurances — Démo API Conformité (ConformIA)
   Design tokens adaptés de la charte ShootnGo (teal/cyan)
   ============================================================ */
:root {
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #22d3ee;
    --primary-soft: rgba(8, 145, 178, 0.1);
    --ink: #0b2b38;
    --ink-light: #10394a;
    --bg: #f7f8fa;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --gold: #daae51;
    --gold-light: #f5e6c8;
    --success: #10b981;
    --error: #ef4444;
    --error-dark: #991b1b;
    --warning: #f59e0b;
    --info: #3b82f6;
    --code-bg: #0b1c26;
    --code-block: #102836;
    --code-text: #a5f3fc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --mono: 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ======================= */
/* NAVIGATION              */
/* ======================= */
.nav {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    background: rgba(8, 33, 44, 0.94);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 76px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 10px rgba(8,145,178,0.4);
    flex-shrink: 0;
}

.logo-icon i { width: 22px; height: 22px; }

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.1;
    white-space: nowrap;
}

.logo-accent { color: var(--primary-light); }

.logo-tagline {
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255,255,255,0.72);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.nav-link.active {
    color: #fff;
    background: rgba(8,145,178,0.45);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-conn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 280px;
    overflow: hidden;
}

.nav-conn span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conn-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: var(--text-light);
    display: inline-block;
}

.conn-dot.conn-ok {
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52,211,153,0.25);
}

/* ======================= */
/* LAYOUT                  */
/* ======================= */
#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.page-section {
    padding: 2.5rem 2rem 3.5rem;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.page-title i { width: 26px; height: 26px; color: var(--primary); }

.page-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.35rem;
    max-width: 640px;
    line-height: 1.55;
}

.page-head-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* ======================= */
/* HERO                    */
/* ======================= */
.hero {
    background: linear-gradient(135deg, #0e7490 0%, #0891b2 55%, #0b2b38 100%);
    padding: 4rem 2rem 4.5rem;
    position: relative;
    overflow: hidden;
    color: white;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.03) 40px, rgba(255,255,255,0.03) 41px),
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.03) 40px, rgba(255,255,255,0.03) 41px);
    pointer-events: none;
}

.hero-bg-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

.hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.14);
    backdrop-filter: blur(10px);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-badge i { width: 14px; height: 14px; }

.hero-title {
    font-size: 2.9rem;
    font-weight: 800;
    line-height: 1.12;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.12rem;
    color: rgba(255,255,255,0.88);
    line-height: 1.65;
    max-width: 640px;
}

/* ======================= */
/* CARDS                   */
/* ======================= */
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem;
    border: 1px solid var(--border-light);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.card-title i { width: 19px; height: 19px; color: var(--primary); }

.card-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    line-height: 1.55;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

/* ======================= */
/* FORMS & BUTTONS         */
/* ======================= */
.form-group { margin-bottom: 1.25rem; }

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
    color: var(--text);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8,145,178,0.12);
}

.form-input-mono { font-family: var(--mono); font-size: 0.88rem; letter-spacing: 0.02em; }

.form-hint {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-top: 0.4rem;
    line-height: 1.5;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn i { width: 17px; height: 17px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px rgba(8,145,178,0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8,145,178,0.35);
}

.btn-outline {
    background: white;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover { background: var(--border-light); color: var(--text); }

.btn-danger-soft {
    background: #fef2f2;
    color: #dc2626;
}

.btn-danger-soft:hover { background: #fecaca; }

.btn-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1.5px solid #fde68a;
}

.btn-warning:hover { background: #fef3c7; }

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    border-radius: 7px;
}

.btn-sm i { width: 14px; height: 14px; }

.btn-full { width: 100%; }

.btn-icon {
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: white;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon i { width: 16px; height: 16px; }

/* ======================= */
/* SPINNER                 */
/* ======================= */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
    flex-shrink: 0;
}

.spinner-dark {
    border-color: var(--border);
    border-top-color: var(--primary);
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-block {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading-block .spinner-dark {
    width: 30px;
    height: 30px;
    border-width: 3px;
    margin: 0 auto 1rem;
    display: block;
}

/* ======================= */
/* ALERTS                  */
/* ======================= */
.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.5;
}

.alert i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

.alert ul { margin: 0.35rem 0 0 1.1rem; }

/* ======================= */
/* BADGES & CHIPS          */
/* ======================= */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.28rem 0.8rem;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-badge-lg {
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
    border-radius: 24px;
}

.status-badge-lg i { width: 17px; height: 17px; }

.st-en_attente { background: #f1f5f9; color: #64748b; }
.st-en_analyse { background: #dbeafe; color: #2563eb; }
.st-conforme { background: #d1fae5; color: #059669; }
.st-non_conforme { background: #fee2e2; color: #dc2626; }
.st-incomplet { background: #ffedd5; color: #c2410c; }
.st-erreur { background: #fecaca; color: #7f1d1d; }

.pulse-dot {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    animation: pulseDot 1.4s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.7); }
}

.code-chip {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 0.16rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(8,145,178,0.2);
    white-space: nowrap;
}

.sev-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.sev-obligatoire { background: var(--gold-light); color: #92700c; }
.sev-facultatif { background: #f1f5f9; color: #64748b; }

.req-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.14rem 0.55rem;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.req-oui { background: var(--gold-light); color: #92700c; }
.req-non { background: #f1f5f9; color: #64748b; }

.extr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.16rem 0.6rem;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.extr-en_attente { background: #f1f5f9; color: #64748b; }
.extr-ok { background: #d1fae5; color: #059669; }
.extr-erreur { background: #fee2e2; color: #dc2626; }

.rr-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.7rem;
    border-radius: 14px;
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
}

.rr-badge i { width: 13px; height: 13px; }

.rr-conforme { background: #d1fae5; color: #059669; }
.rr-non_conforme { background: #fee2e2; color: #dc2626; }
.rr-indeterminable { background: #ffedd5; color: #c2410c; }

/* Filter chips */
.chips-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.chip {
    padding: 0.42rem 0.95rem;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: inherit;
    transition: var(--transition);
}

.chip:hover { border-color: var(--primary); color: var(--primary); }

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ======================= */
/* HOME : CONNEXION        */
/* ======================= */
.connect-wrap {
    max-width: 560px;
    margin: -2.5rem auto 0;
    position: relative;
    z-index: 2;
}

.connect-card { padding: 2rem; }

.key-icon-round {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(8,145,178,0.3);
}

.key-icon-round i { width: 24px; height: 24px; color: white; }

/* Parcours panel */
.parcours-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.parcours-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.doc-item, .rule-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-light);
}

.doc-item:last-child, .rule-item:last-child { border-bottom: none; padding-bottom: 0; }

.doc-item-label, .rule-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.doc-item-desc, .rule-item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    line-height: 1.5;
}

.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ======================= */
/* STEPPER                 */
/* ======================= */
.stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 2rem;
}

.stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 110px;
}

.stepper-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid var(--border);
    color: var(--text-muted);
    background: white;
    transition: var(--transition);
}

.stepper-num i { width: 17px; height: 17px; }

.stepper-step.active .stepper-num {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(8,145,178,0.15);
}

.stepper-step.done .stepper-num {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.stepper-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
}

.stepper-step.active .stepper-label { color: var(--primary); font-weight: 700; }
.stepper-step.done .stepper-label { color: var(--success); }

.stepper-line {
    flex: 1;
    max-width: 90px;
    height: 2px;
    background: var(--border);
    margin-top: 19px;
}

.stepper-line.done { background: var(--success); }

/* ======================= */
/* WIZARD LAYOUT           */
/* ======================= */
.wizard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 1.75rem;
    align-items: start;
}

.wizard-main { min-width: 0; }

/* Doc upload rows */
.doc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.doc-row:last-of-type { border-bottom: none; }

.doc-row-info { flex: 1; min-width: 220px; }

.doc-row-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.doc-row-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.doc-row-action {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.file-btn { position: relative; overflow: hidden; }
.file-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
}

.doc-uploading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.doc-ok {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.84rem;
    color: var(--success);
    font-weight: 600;
    max-width: 280px;
}

.doc-ok i { width: 16px; height: 16px; flex-shrink: 0; }
.doc-ok .doc-ok-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-ok .doc-ok-size { color: var(--text-light); font-weight: 500; }

.doc-error {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--error);
    font-weight: 600;
}

.doc-error i { width: 15px; height: 15px; }

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Recap step 3 */
.recap-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.recap-line:last-child { border-bottom: none; }
.recap-label { color: var(--text-muted); font-weight: 500; }
.recap-value { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.success-panel {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.success-icon-big {
    width: 72px;
    height: 72px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(16,185,129,0.35);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon-big i { width: 34px; height: 34px; color: white; }

@keyframes popIn {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ======================= */
/* API PANEL (pédagogique) */
/* ======================= */
.api-panel {
    background: var(--code-bg);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.api-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.api-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.api-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
}

.api-panel-title i { width: 17px; height: 17px; color: var(--primary-light); }

.api-panel-intro {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.key-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.8);
    font-size: 0.72rem;
    font-weight: 600;
    font-family: inherit;
    padding: 0.32rem 0.7rem;
    border-radius: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.key-toggle:hover { background: rgba(255,255,255,0.15); color: white; }
.key-toggle i { width: 13px; height: 13px; }

.code-block {
    background: var(--code-block);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    margin-bottom: 0.9rem;
    overflow: hidden;
    transition: var(--transition);
}

.code-block:last-child { margin-bottom: 0; }

.code-block-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.55rem 0.5rem 0.8rem;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.code-block-title {
    flex: 1;
    font-size: 0.74rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.02em;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.code-state {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.14rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
}

.code-state-done { background: rgba(16,185,129,0.18); color: #34d399; }
.code-state-current { background: rgba(34,211,238,0.18); color: #22d3ee; }
.code-state-future { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.45); }

.code-copy-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.code-copy-btn:hover { color: white; background: rgba(255,255,255,0.1); }
.code-copy-btn i { width: 14px; height: 14px; }
.code-copy-btn.copied { color: #34d399; }

.code-block pre {
    margin: 0;
    padding: 0.8rem 0.95rem;
    overflow-x: auto;
}

.code-block pre::-webkit-scrollbar { height: 5px; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); }

.code-block code {
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.6;
    color: var(--code-text);
    white-space: pre;
}

.code-block.code-block-current { border-color: rgba(34,211,238,0.45); box-shadow: 0 0 0 1px rgba(34,211,238,0.2); }
.code-block.code-block-future { opacity: 0.55; }

/* Collapsible curl (pages liste / détail / accueil) */
.curl-details {
    margin-top: 1.5rem;
    background: var(--code-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.curl-details summary {
    cursor: pointer;
    padding: 0.8rem 1.1rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    list-style: none;
    user-select: none;
    transition: var(--transition);
}

.curl-details summary::-webkit-details-marker { display: none; }
.curl-details summary:hover { background: rgba(255,255,255,0.05); }
.curl-details summary i { width: 15px; height: 15px; color: var(--primary-light); }

.curl-details summary .curl-chevron {
    margin-left: auto;
    transition: transform 0.25s ease;
    color: rgba(255,255,255,0.5);
}

.curl-details[open] summary .curl-chevron { transform: rotate(90deg); }

.curl-details-body { padding: 0 1rem 1rem; }
.curl-details-body .code-block { margin-bottom: 0; }

.curl-details-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 0 0.6rem;
}

/* ======================= */
/* TABLES                  */
/* ======================= */
.table-card {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-scroll { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 0.85rem 1.5rem;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.9rem 1.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.data-table tbody tr.clickable {
    cursor: pointer;
    transition: var(--transition);
}

.data-table tbody tr.clickable:hover { background: rgba(8,145,178,0.045); }

.td-ref {
    font-weight: 700;
    color: var(--primary-dark);
    font-family: var(--mono);
    font-size: 0.84rem;
}

.td-muted { color: var(--text-muted); font-size: 0.82rem; white-space: nowrap; }

.docs-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.docs-count i { width: 14px; height: 14px; }
.docs-count.ok { color: var(--success); }
.docs-count.partial { color: #c2410c; }

.autorefresh-note {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-light);
}

.autorefresh-note .pulse-dot { color: var(--info); width: 7px; height: 7px; min-width: 7px; }

/* ======================= */
/* DETAIL DOSSIER          */
/* ======================= */
.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1.25rem;
    background: none;
    border: none;
    font-family: inherit;
    transition: var(--transition);
    text-decoration: none;
}

.detail-back:hover { color: var(--primary); }
.detail-back i { width: 16px; height: 16px; }

.detail-status-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.detail-status-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.detail-ref {
    font-family: var(--mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.detail-explain {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.detail-dates {
    display: flex;
    gap: 1.75rem;
    flex-wrap: wrap;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-light);
}

.detail-date-item { font-size: 0.82rem; color: var(--text-muted); }
.detail-date-item strong { display: block; color: var(--text); font-size: 0.88rem; margin-top: 0.15rem; font-weight: 600; }

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}

.summary-card.sc-gold::before { background: linear-gradient(90deg, var(--gold), #c09a38); }
.summary-card.sc-grey::before { background: var(--text-light); }

.summary-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.1;
}

.summary-value .summary-total { font-size: 1.05rem; color: var(--text-light); font-weight: 600; }

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    font-weight: 500;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

.doc-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.doc-list-item:last-child { border-bottom: none; padding-bottom: 0; }

.doc-list-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    overflow-wrap: anywhere;
}

.rule-result {
    padding: 0.95rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    border-left-width: 4px;
    margin-bottom: 0.75rem;
    background: white;
}

.rule-result:last-child { margin-bottom: 0; }

.rule-result.rrb-conforme { border-left-color: var(--success); background: #f6fdf9; }
.rule-result.rrb-non_conforme { border-left-color: var(--error); background: #fef6f6; }
.rule-result.rrb-indeterminable { border-left-color: var(--warning); background: #fffdf5; }

.rule-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.rule-result-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.rule-result-reason {
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-top: 0.45rem;
    line-height: 1.55;
}

/* ======================= */
/* EMPTY STATE             */
/* ======================= */
.empty-state {
    text-align: center;
    padding: 3.5rem 2rem;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.empty-icon i { width: 28px; height: 28px; color: var(--primary); }

.empty-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.4rem;
}

.empty-text {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 0.92rem;
    line-height: 1.55;
}

/* ======================= */
/* TOASTS                  */
/* ======================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: min(420px, calc(100vw - 40px));
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    border-left: 4px solid var(--info);
    animation: toastIn 0.35s ease;
}

.toast.leaving { animation: toastOut 0.3s ease forwards; }

.toast i { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }

.toast-msg {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.45;
    flex: 1;
    overflow-wrap: anywhere;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 0.15rem;
    flex-shrink: 0;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* ======================= */
/* SKELETON                */
/* ======================= */
.skeleton {
    background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ======================= */
/* FOOTER                  */
/* ======================= */
.footer {
    background: linear-gradient(180deg, #0b2b38 0%, #071c26 100%);
    color: rgba(255,255,255,0.6);
    padding: 1.4rem 2rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    font-size: 0.88rem;
}

.footer-brand i { color: var(--primary-light); }

.footer-note { font-size: 0.78rem; }
.footer-note code {
    font-family: var(--mono);
    background: rgba(255,255,255,0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
    font-size: 0.72rem;
    color: var(--primary-light);
}

/* ======================= */
/* UTILITIES               */
/* ======================= */
.hidden { display: none !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }

/* ======================= */
/* RESPONSIVE              */
/* ======================= */
@media (max-width: 1080px) {
    .wizard-layout { grid-template-columns: 1fr; }
    .api-panel { position: static; max-height: none; }
    .parcours-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav { padding: 0 1rem; }
    .nav-inner {
        height: auto;
        min-height: 64px;
        flex-wrap: wrap;
        padding: 0.6rem 0;
        row-gap: 0.4rem;
    }
    .logo-tagline { display: none; }
    .nav-links { order: 3; width: 100%; overflow-x: auto; }
    .nav-link { padding: 0.4rem 0.7rem; font-size: 0.82rem; }
    .nav-conn { max-width: 160px; font-size: 0.72rem; }

    .hero { padding: 2.5rem 1.25rem 3rem; }
    .hero-title { font-size: 1.9rem; }
    .hero-subtitle { font-size: 0.98rem; }

    .page-section { padding: 1.5rem 1rem 2.5rem; }
    .card { padding: 1.25rem; }
    .connect-wrap { margin-top: -1.5rem; }

    .stepper-step { min-width: 72px; }
    .stepper-label { font-size: 0.68rem; }
    .stepper-line { max-width: 40px; }

    .data-table th, .data-table td { padding: 0.65rem 0.85rem; font-size: 0.8rem; }
    .detail-dates { gap: 1rem; }

    .doc-row-action { width: 100%; justify-content: flex-start; }
    .wizard-footer { flex-direction: column-reverse; align-items: stretch; }
    .wizard-footer .btn { width: 100%; }

    .footer-inner { flex-direction: column; align-items: flex-start; }
}
