/* ================================================================
   DESIGN TOKENS
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
    --green:        #7eb941;
    --green-dark:   #5e8e25;
    --green-light:  #eaf4d5;
    --blue:         #249dd4;
    --blue-dark:    #1878a8;
    --blue-xdark:   #0f1e2e;
    --blue-light:   #daeef9;
    --blue-pale:    #edf6fc;
    --bg:           #f2f7fb;
    --white:        #ffffff;
    --ink:          #1c2b3a;
    --muted:        #607080;
    --border:       #cddae5;
    --error:        #d63b2f;

    --radius:       12px;
    --radius-sm:    8px;
    --shadow:       0 4px 20px rgba(36,157,212,0.12);
    --shadow-sm:    0 1px 6px rgba(36,157,212,0.08);

    --font-display: 'Poppins', system-ui, sans-serif;
    --font-ui:      'Inter', system-ui, -apple-system, sans-serif;

    --header-h:     68px;
}

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-ui);
    font-size: 1rem;
    line-height: 1.6;
    background: var(--bg);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--blue); }

img, svg { max-width: 100%; }

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

/* ================================================================
   HEADER
   ================================================================ */
.site-header {
    background: var(--blue);
    color: #0f1e2e;
    border-bottom: 4px solid var(--green);
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 16px rgba(36,157,212,0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--header-h);
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
    transition: width 0.2s, height 0.2s, transform 0.2s;
    overflow: hidden;
}
.brand:hover .brand-logo { transform: scale(1.05); }
.brand-logo svg { width: 100%; height: 100%; }

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    color: #ffffff;
    letter-spacing: calc(0.02em * (40 / var(--brand-title-length)));
}
.brand-green { color: var(--green); }
.brand-white { color: #fff; }

.brand-sub {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.82);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nav */
.site-nav {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.nav-link {
    color: #0f1e2e;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.nav-link:hover { color: #0f1e2e; background: rgba(15,30,46,0.08); }

/* Header buttons */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    min-height: 38px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-ui);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    white-space: nowrap;
}
.header-btn:active { transform: translateY(1px); }

.header-btn-outline {
    background: transparent;
    color: #0f1e2e;
    border: 1.5px solid #0f1e2e;
}
.header-btn-outline:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.06);
}

.inline-form { display: inline; margin: 0; }

/* ================================================================
   MAIN WRAP & FOOTER
   ================================================================ */
.main-wrap { flex: 1; }

/* Tagline section */
.tagline-section {
    background: linear-gradient(135deg, #7eb941 0%, #249dd4 100%);
    padding: 1.5rem 1.5rem;
    text-align: center;
    color: #fff;
}

.tagline-content {
    max-width: 600px;
}

.tagline-text {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
    letter-spacing: 0.01em;
    font-family: 'Poppins', Georgia, serif;
    color: #ffffff;
    font-style: italic;
}

.tagline-dot {
    color: #eaf4d5;
}

.tagline-subtitle {
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0.6rem 0 0 0;
    letter-spacing: 0.02em;
    color: rgba(255,255,255,0.9);
    font-family: 'Poppins', Georgia, serif;
    font-style: italic;
}

.site-footer {
    background: var(--blue);
    color: #0f1e2e;
    text-align: center;
    padding: 1.25rem 1rem;
    font-size: 0.78rem;
}

/* ================================================================
   ALERTS
   ================================================================ */
.messages { margin-bottom: 1.5rem; }

.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}
.alert-error  { background: #fdf2f2; color: var(--error); border: 1px solid #f5c6c6; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #b8d98a; }

/* ================================================================
   HERO FULL-SCREEN
   ================================================================ */
.hero-fullscreen {
    display: grid;
    grid-template-columns: 42% 58%;
    height: 500px;
    overflow: hidden;
}

/* LEFT — photo */
.hero-photo {
    position: relative;
    background: linear-gradient(160deg, var(--blue-xdark) 0%, var(--blue-dark) 45%, var(--blue) 100%);
    overflow: hidden;
    height: 100%;
}

/* Photo réelle */
.hero-photo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    z-index: 1;
}

.hero-photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(15,30,46,0.08) 0%,
        rgba(15,30,46,0.0) 55%,
        var(--bg) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* RIGHT — texte */
.hero-content {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem 3rem 2.5rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero-eyebrow-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    width: 100%;
}
.hero-eyebrow {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--white);
    background: var(--green);
    padding: 0.28em 0.9em;
    border-radius: 20px;
    width: fit-content;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    line-height: 1.2;
    color: var(--blue-xdark);
    margin: 0 0 1.1rem;
    font-weight: 700;
}

.hero-message {
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.7;
    margin: 0 0 1.6rem;
}

.hero-points {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.hero-points li {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
}

.hero-point-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blue-pale);
    border: 1.5px solid var(--blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--blue);
}
.hero-point-icon svg { width: 15px; height: 15px; }

.hero-point-link {
    color: var(--green-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(94,142,37,0.4);
    transition: color 0.15s, text-decoration-color 0.15s;
}
.hero-point-link:hover { color: var(--blue-dark); text-decoration-color: var(--blue-dark); }

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--green);
    color: #fff;
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 0.93rem;
    padding: 0.875rem 2rem;
    min-height: 48px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    width: fit-content;
    box-shadow: 0 6px 20px rgba(126,185,65,0.4);
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.hero-cta:hover {
    background: var(--green-dark);
    box-shadow: 0 8px 24px rgba(126,185,65,0.5);
    color: #fff;
    transform: translateY(-1px);
}
.hero-cta:active { transform: none; }

/* ================================================================
   FORM OUTER
   ================================================================ */
.form-outer {
    padding: 3rem 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    scroll-margin-top: 80px;
}

#inscription-form-wrap {
    scroll-margin-top: 80px;
}

/* ================================================================
   PAGES NON-HERO (dashboard, login, success)
   ================================================================ */
.page-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

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

.form-card  { max-width: 860px; margin: 0 auto; }
.login-card { max-width: 420px; margin: 0 auto; }

/* ================================================================
   FORM HEADER
   ================================================================ */
.form-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.form-header h1,
.form-header h2,
.form-card h2 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.45rem);
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 0.4rem;
}

.subtitle { color: var(--muted); margin: 0; font-size: 0.88rem; }

/* ================================================================
   FORM SECTIONS & GRIDS
   ================================================================ */
.form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.form-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.1rem;
}
.form-section-title::before {
    content: '';
    display: inline-block;
    width: 3px; height: 14px;
    background: var(--green);
    border-radius: 2px;
    flex-shrink: 0;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: end;
}
.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* ================================================================
   FORM FIELDS
   ================================================================ */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1.1rem;
}
.form-grid-2 .field,
.form-grid-3 .field { margin-bottom: 0; }

.field label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.req { color: var(--error); }

.field-input,
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    min-height: 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: var(--font-ui);
    background: var(--white);
    color: var(--ink);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: auto;
    resize: vertical;
    -webkit-appearance: auto;
}
.field-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36,157,212,0.15);
}
.field-error .field-input,
.field-error input,
.field-error select,
.field-error textarea {
    border-color: var(--error);
    background: #fff8f8;
}
.field-input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
    font-size: 0.78rem;
    color: #b8c8d5;
    font-style: italic;
}

.error-text { color: var(--error); font-size: 0.78rem; }
.char-counter { font-size: 0.75rem; color: var(--muted); display: block; text-align: right; margin-top: 0.2rem; }

/* ---- Tag-input (multi-université) ---- */
.tag-input-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0.4rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: text;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.tag-input-wrapper:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(36,157,212,0.15);
}
.field-error .tag-input-wrapper {
    border-color: var(--error);
    background: #fff8f8;
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
    padding: 0.2rem 0.6rem 0.2rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tag-chip button {
    background: none;
    border: none;
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.75;
    flex-shrink: 0;
}
.tag-chip button:hover { opacity: 1; }
.tag-text-input {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 0.92rem;
    font-family: var(--font-ui);
    color: var(--ink);
    min-width: 160px;
    flex: 1;
    padding: 0.25rem 0.2rem;
}
.tag-text-input::placeholder {
    font-size: 0.78rem;
    color: #b8c8d5;
    font-style: italic;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.75rem;
    min-height: 48px;
    font-size: 0.95rem;
    font-family: var(--font-ui);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--green);
    color: #fff;
    width: 100%;
    margin-top: 1.5rem;
    box-shadow: 0 4px 14px rgba(126,185,65,0.38);
}
.btn-primary:hover { background: var(--green-dark); box-shadow: 0 6px 18px rgba(126,185,65,0.45); color: #fff; }

.btn-next {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(36,157,212,0.35);
    padding: 0.75rem 2rem;
    width: auto;
    margin-top: 0;
}
.btn-next:hover { background: var(--blue-dark); color: #fff; box-shadow: 0 6px 18px rgba(36,157,212,0.45); }

.btn-back {
    background: transparent;
    color: var(--muted);
    border: 1.5px solid var(--border);
    padding: 0.75rem 1.5rem;
    width: auto;
    margin-top: 0;
}
.btn-back:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }

/* ================================================================
   WIZARD — INDICATEUR D'ÉTAPES
   ================================================================ */
.wizard-steps {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.wizard-step {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    min-width: 0;
}
.wizard-step:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 0.4rem;
    transition: background 0.3s;
    flex-shrink: 0;
}
.wizard-step.done:not(:last-child)::after { background: var(--green); }

.step-num {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--border);
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.3s, color 0.3s;
}
.wizard-step.active .step-num { background: var(--blue); color: #fff; }
.wizard-step.done  .step-num  { background: var(--green); color: #fff; }
.wizard-step.active { color: var(--ink); }
.wizard-step.done   { color: var(--green-dark); }

.step-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pages du wizard */
.wizard-page { display: none; }
.wizard-page.active { display: block; }

/* Navigation wizard */
.wizard-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ================================================================
   RÉCAPITULATIF
   ================================================================ */
.recap-section { margin-bottom: 1.5rem; }

.recap-section-title {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.recap-section-title::before {
    content: '';
    display: inline-block;
    width: 3px; height: 14px;
    background: var(--green);
    border-radius: 2px;
    flex-shrink: 0;
}

.recap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.25rem;
}

.recap-item { display: flex; flex-direction: column; gap: 0.1rem; }

.recap-item-label {
    font-size: 0.66rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
}
.recap-item-value { font-size: 0.92rem; color: var(--ink); font-weight: 500; word-break: break-word; }
.recap-item-value.empty { color: #b8c8d5; font-style: italic; font-weight: 400; }

.recap-alert {
    background: var(--blue-pale);
    border: 1px solid var(--blue-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--blue-dark);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}
.recap-alert-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ================================================================
   SUCCESS PAGE
   ================================================================ */
.success-card { max-width: 480px; margin: 0 auto; text-align: center; }

.success-seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(36,157,212,0.32);
}
.success-seal svg { width: 40px; height: 40px; fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.success-card h1 { font-family: var(--font-display); color: var(--ink); margin-top: 0; font-size: 1.75rem; }
.success-card .btn { width: auto; }
.success-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }

.success-code-block {
    background: var(--blue-pale);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    margin: 1.25rem 0;
    text-align: center;
}
.success-code-label { margin: 0 0 .35rem; font-size: .85rem; color: var(--muted); }
.success-code-row { display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap; }
.success-code {
    font-family: 'Courier New', monospace;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: .2em;
    color: var(--blue-dark);
    margin: 0;
    word-break: break-all;
}
.success-code-hint { margin: .35rem 0 0; font-size: .8rem; color: var(--muted); }
.btn-copy {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--white); border: 1.5px solid var(--blue);
    color: var(--blue); border-radius: var(--radius-sm);
    padding: .3rem .7rem; font-size: .82rem; font-weight: 500;
    cursor: pointer; transition: background .15s, color .15s;
    white-space: nowrap;
}
.btn-copy:hover { background: var(--blue); color: var(--white); }
.btn-copy-sm { padding: .2rem .5rem; font-size: .75rem; }

/* ── Bouton Détails ── */
.btn-detail {
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--blue-pale); border: 1px solid var(--blue-light);
    color: var(--blue-dark); border-radius: var(--radius-sm);
    padding: .28rem .7rem; font-size: .78rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: background .15s, color .15s;
}
.btn-detail:hover { background: var(--blue); color: var(--white); border-color: var(--blue); }

/* ── Modal détails ── */
.detail-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(15,30,46,.55); z-index: 1000;
    align-items: center; justify-content: center;
    padding: 1rem;
}
.detail-overlay.open { display: flex; }

.detail-modal {
    background: var(--white); border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(15,30,46,.25);
    width: 100%; max-width: 600px; max-height: 90vh;
    overflow-y: auto; display: flex; flex-direction: column;
}
.detail-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 1.4rem .9rem;
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--white); z-index: 1;
}
.detail-modal-name { margin: 0; font-size: 1.15rem; color: var(--ink); font-family: var(--font-display); }
.detail-close {
    background: none; border: none; font-size: 1.6rem; line-height: 1;
    color: var(--muted); cursor: pointer; padding: 0 .25rem;
    transition: color .15s;
}
.detail-close:hover { color: var(--error); }

.detail-modal-body { padding: 1.1rem 1.4rem 1.4rem; }

.detail-code-row {
    display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    background: var(--blue-pale); border-radius: var(--radius-sm);
    padding: .55rem .9rem; margin-bottom: 1rem;
}
.detail-code {
    font-family: 'Courier New', monospace; font-size: 1.05rem;
    font-weight: 700; letter-spacing: .15em; color: var(--blue-dark);
    flex: 1; word-break: break-all;
}

.detail-section { margin-bottom: 1rem; }
.detail-section-title {
    font-size: .7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--muted);
    margin: 0 0 .5rem; padding-bottom: .35rem;
    border-bottom: 1px solid var(--border);
}
.detail-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem;
}
.detail-item { display: flex; flex-direction: column; gap: .1rem; }
.detail-label { font-size: .7rem; color: var(--muted); font-weight: 500; }
.detail-value { font-size: .88rem; color: var(--ink); font-weight: 500; word-break: break-word; }

.detail-date { margin: .75rem 0 0; font-size: .8rem; color: var(--muted); text-align: right; }

@media (max-width: 480px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-modal-header { padding: .9rem 1rem .75rem; }
    .detail-modal-body { padding: .9rem 1rem 1rem; }
}

/* Checkbox custom */
.field-checkbox {
    display: flex; align-items: flex-end; padding-bottom: .25rem;
}
.checkbox-label {
    display: inline-flex; align-items: center; gap: .4rem;
    cursor: pointer; font-weight: 500; color: var(--ink);
    user-select: none;
}
.checkbox-label input[type="checkbox"] {
    width: 15px; height: 15px; flex-shrink: 0;
    accent-color: var(--blue); cursor: pointer;
    margin: 0;
}
.checkbox-text { font-size: .88rem; }

/* Alert succès */
.alert-success {
    background: var(--green-light); border-left: 4px solid var(--green);
    color: var(--ink); padding: .75rem 1rem; border-radius: var(--radius-sm);
    font-size: .9rem;
}

.btn-outline-blue {
    background: transparent;
    border: 2px solid var(--blue);
    color: var(--blue);
    font-weight: 600;
}
.btn-outline-blue:hover { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(36,157,212,0.35); }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-card h1 { font-family: var(--font-display); color: var(--ink); margin-top: 0; font-size: 1.55rem; }

/* ================================================================
   DASHBOARD
   ================================================================ */
.dashboard-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding: 1.25rem 1.75rem;
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}
.dashboard-header h1 { font-family: var(--font-display); color: #fff; margin: 0; font-size: clamp(1.2rem, 3vw, 1.75rem); }

.stats-strip { display: flex; gap: 0.75rem; margin-bottom: 1.75rem; flex-wrap: wrap; }

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.4rem;
    flex: 1;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    box-shadow: var(--shadow-sm);
}
.stat-total { background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%); border-color: transparent; box-shadow: 0 4px 14px rgba(36,157,212,0.3); }
.stat-total .stat-label { color: rgba(255,255,255,0.65); }
.stat-total .stat-value { color: #fff; }
.stat-value { font-size: clamp(1rem, 2.5vw, 1.55rem); font-weight: 700; color: var(--blue); line-height: 1; font-family: var(--font-display); word-break: break-all; }
.stat-label { font-size: 0.7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Toolbar : filtres + exports ── */
.dash-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-sm);
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.filter-select {
    font-family: var(--font-ui);
    font-size: 0.82rem;
    padding: 0.38rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink);
    cursor: pointer;
    transition: border-color 0.2s;
}
.filter-select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,157,212,0.15); }

.filter-reset {
    font-size: 0.78rem;
    color: var(--blue);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.filter-reset:hover { background: var(--blue-light); }

.filter-count {
    font-size: 0.78rem;
    color: var(--muted);
    margin-left: auto;
    white-space: nowrap;
}

.export-group {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: opacity 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.btn-export:hover { opacity: 0.85; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.btn-export-full   { background: var(--green); color: #fff; }
.btn-export-phones { background: var(--blue);  color: #fff; }

/* ── Table wide ── */
.table-wrapper { overflow-x: auto; background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th,
.data-table td { padding: 0.7rem 0.9rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table thead th { background: var(--blue-pale); color: var(--blue-dark); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.07em; text-transform: uppercase; }
.data-table tbody tr:hover td { background: var(--blue-pale); }
.data-table .empty { text-align: center; color: var(--muted); padding: 3rem; white-space: normal; }

/* ================================================================
   BADGES
   ================================================================ */
.badge { display: inline-block; padding: 0.22em 0.65em; border-radius: 20px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em; line-height: 1.4; }
.badge-oui   { background: #e6f7ee; color: #1a7a45; }
.badge-non   { background: #fdecea; color: #b02a1e; }
.badge-sms-on  { background: #e6f7ee; color: #1a7a45; }
.badge-sms-off { background: #f3f4f6; color: #6b7280; }
.badge-admissible  { background: var(--blue-light);  color: var(--blue-dark); }
.badge-passable    { background: #e8f0fe; color: #1a56b0; }
.badge-assez-bien  { background: var(--blue-light);  color: var(--blue-dark); }
.badge-bien        { background: var(--green-light); color: var(--green-dark); }
.badge-tres-bien   { background: #c8e89a; color: #3a6e10; }
.badge-excellent   { background: var(--green); color: #fff; }

/* ================================================================
   CONSENTEMENTS
   ================================================================ */
.consent-block {
    background: var(--blue-pale);
    border: 1px solid var(--blue-light);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.consent-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blue-dark);
    margin: 0 0 0.25rem;
}

.consent-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

/* Cache la checkbox native */
.consent-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Checkbox custom */
.consent-box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
    margin-top: 1px;
    flex-shrink: 0;
}

.consent-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border-right: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0;
    transition: opacity 0.15s;
}

.consent-check:checked ~ .consent-box {
    background: var(--blue);
    border-color: var(--blue);
}
.consent-check:checked ~ .consent-box::after {
    opacity: 1;
}

.consent-item:hover .consent-box {
    border-color: var(--blue);
}

.consent-item:focus-within .consent-box {
    box-shadow: 0 0 0 3px rgba(36,157,212,0.2);
    border-color: var(--blue);
}

.consent-text {
    font-size: 0.875rem;
    color: var(--ink);
    line-height: 1.55;
    user-select: none;
}

/* Item optionnel : séparé par une ligne */
.consent-optional {
    padding-top: 0.75rem;
    border-top: 1px dashed var(--border);
}
.consent-optional .consent-check:checked ~ .consent-box {
    background: var(--green);
    border-color: var(--green);
}
.consent-optional:hover .consent-box { border-color: var(--green); }
.consent-optional:focus-within .consent-box {
    box-shadow: 0 0 0 3px rgba(126,185,65,0.2);
    border-color: var(--green);
}

/* Erreur */
.consent-error .consent-box {
    border-color: var(--error) !important;
    background: #fff8f8;
}
.consent-error .consent-text { color: var(--error); }

.consent-note {
    font-size: 0.72rem;
    color: var(--muted);
    margin: 0.25rem 0 0;
}

.consent-link {
    color: var(--blue);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.consent-link:hover { color: var(--blue-dark); }

/* ================================================================
   ▌ RESPONSIVE — 860px (tablette paysage → portrait)
   ================================================================ */
@media (max-width: 860px) {

    /* Hero : bascule en colonne */
    .hero-fullscreen {
        grid-template-columns: 1fr;
        height: auto;
    }
    .hero-photo {
        height: 280px;
        min-height: unset;
        border-bottom: none;
    }
    .hero-photo-overlay {
        background: linear-gradient(to bottom, transparent 0%, rgba(242,247,251,0.9) 80%, var(--bg) 100%);
    }
    .hero-content {
        padding: 2rem 2rem 2rem;
    }
    .hero-content h1 { font-size: 1.75rem; }
    .hero-cta { width: 100%; justify-content: center; }
    .hero-eyebrow-row { width: 100%; }
}

/* ================================================================
   ▌ RESPONSIVE — 700px (tablette portrait)
   ================================================================ */
@media (max-width: 700px) {

    /* Header */
    .brand-sub  { display: none; }
    .site-nav   { display: none; }
    .brand-logo { width: 34px; height: 34px; min-width: 34px; }

    /* Stats : 2 colonnes */
    .stats-strip { display: grid; grid-template-columns: 1fr 1fr; }

    /* Grilles formulaire : rester en 2 col jusqu'à 480px */
    .form-grid-3 { grid-template-columns: 1fr 1fr; }

    /* Hero */
    .hero-photo { height: 240px; }
    .hero-content { padding: 1.75rem 1.5rem; }
    .hero-content h1 { font-size: 1.55rem; }
    .hero-eyebrow { font-size: 0.63rem; padding: 0.26em 0.75em; }
}

/* ================================================================
   ▌ RESPONSIVE — 580px (grand téléphone)
   ================================================================ */
@media (max-width: 580px) {
    .hero-photo { height: 200px; }
    .hero-content { padding: 1.5rem 1.25rem; }
    .hero-content h1 { font-size: 1.4rem; }
    .hero-eyebrow { font-size: 0.6rem; padding: 0.24em 0.65em; }

    .form-outer  { padding: 1.75rem 1rem; }
    .page-container { padding: 1.75rem 1rem 2rem; }
    .card { padding: 1.5rem 1.1rem; }
}

/* ================================================================
   ▌ RESPONSIVE — 480px (téléphone moyen)
   ================================================================ */
@media (max-width: 480px) {

    :root { --header-h: 56px; }

    /* Header compact */
    .brand-logo { width: 28px; height: 28px; min-width: 28px; }
    .brand-title { font-size: 0.82rem; }

    /* Hero */
    .hero-photo { height: 180px; }
    .hero-content { padding: 1.5rem 1rem 1.25rem; }
    .hero-content h1 { font-size: 1.25rem; }
    .hero-message { font-size: 0.85rem; }
    .hero-points { gap: 0.55rem; }
    .hero-points li { font-size: 0.8rem; }
    .hero-eyebrow { font-size: 0.55rem; padding: 0.22em 0.55em; letter-spacing: 0.08em; }
    .hero-eyebrow-row { gap: 0.3rem; }

    /* Formulaire : 1 colonne */
    .form-grid-2,
    .form-grid-3 { grid-template-columns: 1fr; }
    .recap-grid  { grid-template-columns: 1fr; }

    /* Wizard steps : cacher les labels */
    .step-label { display: none; }
    .wizard-step:not(:last-child)::after { margin: 0 0.3rem; }

    /* Boutons wizard en colonne */
    .wizard-nav {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    .wizard-nav .btn { width: 100%; }

    /* Stats : 1 colonne */
    .stats-strip { grid-template-columns: 1fr; }

    /* Consentements */
    .consent-block { padding: 1rem 0.9rem; gap: 0.75rem; }
    .consent-text  { font-size: 0.82rem; }

    /* Dashboard header compact */
    .dashboard-header { padding: 1rem; }
    .dashboard-header svg { display: none; }

    /* Dashboard toolbar : empile verticalement */
    .dash-toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .filter-form  { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .filter-group { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .filter-select { width: 100%; }
    .export-group { justify-content: stretch; }
    .btn-export   { flex: 1; justify-content: center; }
    .filter-count { margin-left: 0; }

    /* Card padding minimal */
    .card { padding: 1.1rem 0.9rem; }
    .form-outer  { padding: 1.25rem 0.75rem; }
    .page-container { padding: 1.25rem 0.75rem 1.5rem; }
}

/* ================================================================
   ▌ RESPONSIVE — 375px (petit téléphone — iPhone SE, etc.)
   ================================================================ */
@media (max-width: 375px) {

    .brand-text { display: none; }
    .brand-logo { width: 30px; height: 30px; min-width: 30px; }

    .hero-photo { height: 160px; }
    .hero-content { padding: 1.25rem 0.85rem; }
    .hero-content h1 { font-size: 1.1rem; }
    .hero-eyebrow { font-size: 0.5rem; padding: 0.2em 0.5em; letter-spacing: 0.06em; }
    .hero-eyebrow-row { gap: 0.25rem; margin-bottom: 0.9rem; }

    .field-input,
    .field input,
    .field select,
    .field textarea { font-size: 0.9rem; }

    .btn { font-size: 0.88rem; padding: 0.7rem 1.2rem; }
    .hero-cta { font-size: 0.85rem; padding: 0.8rem 1.2rem; }
}

/* ================================================================
   PAGE CONFIGURATION
   ================================================================ */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.config-section {
    padding: 1.5rem 1.75rem;
}

.config-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--blue-dark);
    margin: 0 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--blue-light);
}
.config-section-title svg { flex-shrink: 0; color: var(--blue); }

.field-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-top: 0.2rem;
    line-height: 1.4;
}

.logo-preview-wrap {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.logo-preview-wrap .field-hint {
    display: inline;
    font-size: 0.78rem;
    white-space: nowrap;
}
.logo-preview {
    width: 56px;
    height: 56px;
    background: var(--blue-xdark);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.logo-preview svg { width: 46px; height: 46px; }

.config-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.5rem 0 1rem;
}

.btn-back-link {
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}
.btn-back-link:hover { background: var(--blue-light); color: var(--blue-dark); }

/* Footer enrichi */
.footer-inner { display: flex; flex-direction: column; gap: 0.25rem; text-align: center; }
.footer-contact, .footer-social { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin: 0; }
.footer-link { color: rgba(255,255,255,0.8); text-decoration: none; }
.footer-link:hover { color: #fff; text-decoration: underline; }

/* Alert success */
.alert-success {
    background: var(--green-light);
    color: var(--green-dark);
    border: 1px solid #c3e09a;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ================================================================
   PAGES LÉGALES (CGU / Politique de confidentialité)
   ================================================================ */
.legal-page {
    max-width: 780px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

.legal-hero {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
    border-radius: var(--radius);
    padding: 2.5rem 2.5rem 2rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.legal-hero::after {
    content: '';
    position: absolute;
    right: -40px; top: -40px;
    width: 220px; height: 220px;
    border-radius: 50%;
    border: 40px solid rgba(126,185,65,0.12);
    pointer-events: none;
}

.legal-hero-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--white);
    background: rgba(126,185,65,0.25);
    border: 1px solid rgba(126,185,65,0.45);
    padding: 0.3em 0.9em;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.legal-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #fff;
    margin: 0 0 0.6rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.legal-hero-meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.58);
    margin: 0;
    position: relative;
    z-index: 1;
}

.legal-toc {
    background: var(--blue-pale);
    border: 1px solid var(--blue-light);
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.legal-toc-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue-dark);
    margin: 0 0 0.75rem;
}

.legal-toc ol {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.legal-toc a {
    font-size: 0.875rem;
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
}
.legal-toc a:hover { text-decoration: underline; }

.legal-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: calc(var(--header-h) + 1rem);
}

.legal-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue-xdark);
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--green-light);
}

.legal-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.legal-section p {
    font-size: 0.93rem;
    color: var(--ink);
    line-height: 1.75;
    margin: 0 0 0.9rem;
}

.legal-section ul, .legal-section ol {
    padding-left: 1.4rem;
    margin: 0 0 0.9rem;
}

.legal-section li {
    font-size: 0.9rem;
    color: var(--ink);
    line-height: 1.7;
    margin-bottom: 0.4rem;
}

.legal-highlight {
    background: var(--green-light);
    border-left: 3px solid var(--green);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 0.9rem 1.25rem;
    margin: 1rem 0;
    font-size: 0.88rem;
    color: var(--green-dark);
    font-weight: 500;
}

.legal-contact-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.legal-contact-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--blue-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--blue);
}

.legal-contact-icon svg { width: 20px; height: 20px; }

.legal-contact-body p {
    margin: 0 0 0.25rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.legal-contact-body strong {
    font-size: 0.95rem;
    color: var(--ink);
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
}
.legal-back:hover { color: var(--blue); }

@media (max-width: 580px) {
    .legal-hero { padding: 1.75rem 1.25rem 1.5rem; }
    .legal-page  { padding: 1.5rem 1rem 3rem; }
    .legal-toc   { padding: 1rem; }
}

/* ================================================================
   PRÉFÉRENCE : pas d'animation
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
