﻿/* ===== Pages d'authentification ZENRx (login, inscription) ===== */
:root {
    --ink-950: #040d1d;
    --ink-900: #06142b;
    --ink-800: #0b1f3f;
    --teal: #14b8a6;
    --mint: #5eead4;
    --sky: #60a5fa;
    --brand: #0b6fe0;
    --brand-dark: #0a58b8;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --text: #0b1324;
    --muted: #5a6a80;
    --border: #dbe3ee;
    --danger: #d93025;
    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --serif: "Instrument Serif", Georgia, serif;
}

html, body {
    height: 100%;
}

/* Retire l'image de fond définie dans AccountCss.css */
body {
    background: var(--bg) !important;
    font-family: var(--font);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

/* ---------- Panneau de marque ---------- */
.auth-brand {
    display: none;
    position: relative;
    overflow: hidden;
    padding: 56px 56px 40px;
    color: #fff;
    background:
        radial-gradient(520px 380px at 10% 0%, rgba(94, 234, 212, .20), transparent 65%),
        radial-gradient(560px 420px at 100% 100%, rgba(96, 165, 250, .22), transparent 65%),
        linear-gradient(160deg, var(--ink-900) 0%, var(--ink-800) 100%);
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
    pointer-events: none;
}

.auth-brand-watermark {
    position: absolute;
    right: -70px;
    bottom: -60px;
    width: 380px;
    opacity: .06;
    pointer-events: none;
}

.auth-brand-body {
    position: relative;
    max-width: 460px;
    margin: auto 0;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
}

.auth-eyebrow .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 0 4px rgba(94, 234, 212, .18);
}

.auth-brand h2 {
    margin: 22px 0 14px;
    font-family: var(--font);
    font-size: clamp(2rem, 3vw, 2.7rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.02em;
    color: #fff;
}

.auth-brand h2 em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    color: var(--mint);
}

.auth-brand p {
    font-size: 1.02rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .72);
    margin-bottom: 30px;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: .95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .88);
}

.auth-points li span {
    flex: 0 0 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    color: var(--mint);
}

.auth-brand-foot {
    position: relative;
    margin: 0 !important;
    font-size: .82rem !important;
    color: rgba(255, 255, 255, .45) !important;
}

/* ---------- Zone formulaire ---------- */
.auth-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 28px;
}

.auth-topbar {
    width: 100%;
    max-width: 440px;
    margin-bottom: 12px;
}

.auth-topbar a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--muted);
    transition: color .2s;
}

.auth-topbar a:hover { color: var(--brand); }

.auth-card {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
    padding: 36px 32px 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 2px 6px rgba(6, 20, 43, .04), 0 24px 60px rgba(6, 20, 43, .08);
    text-align: center;
}

.auth-logo {
    display: inline-block;
    margin-bottom: 18px;
}

.auth-logo img {
    height: 96px;
    width: auto;
}

.auth-card h1 {
    margin: 0 0 6px;
    font-family: var(--font);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text);
}

.auth-sub {
    margin-bottom: 26px;
    font-size: .95rem;
    color: var(--muted);
}

.auth-form { text-align: left; }

.auth-alert.validation-summary-valid { display: none; }

.auth-alert.validation-summary-errors {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fdecea;
    border: 1px solid #f6c3be;
    color: var(--danger);
    font-size: .9rem;
    font-weight: 600;
}

.auth-alert ul { margin: 0; padding-left: 18px; }

.auth-group { margin-bottom: 18px; }

.auth-group > label:not(.reg-file),
.auth-label-row label {
    display: block;
    margin-bottom: 7px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
}

.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.auth-label-row a {
    font-size: .85rem;
    font-weight: 600;
    color: var(--brand);
}

.auth-label-row a:hover { color: var(--brand-dark); text-decoration: underline; }

.auth-field { position: relative; }

.auth-field > i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a99ad;
    font-size: .95rem;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    height: 50px;
    padding: 0 46px 0 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfcfe;
    font-family: var(--font);
    font-size: .98rem;
    color: var(--text);
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.auth-input::placeholder { color: #9aa8ba; }

.auth-input:focus {
    outline: none;
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11, 111, 224, .12);
}

.auth-input.input-validation-error { border-color: var(--danger); }

/* Code à usage unique (vérification en deux étapes) */
.auth-input--code {
    height: 60px;
    padding: 0 0 0 .5em;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: .5em;
}

.auth-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #8a99ad;
    cursor: pointer;
}

.auth-eye:hover, .auth-eye:focus { color: var(--brand); background: #eef4fd; outline: none; }

.auth-error {
    display: block;
    margin-top: 6px;
    font-size: .83rem;
    font-weight: 500;
    color: var(--danger);
}

.auth-remember { margin: 4px 0 22px; }

.auth-remember .custom-control-label {
    font-size: .9rem;
    color: var(--muted);
    cursor: pointer;
}

.auth-remember .custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--brand);
    background-color: var(--brand);
}

.auth-remember .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px rgba(11, 111, 224, .18);
}

.auth-btn {
    width: 100%;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #0b5ed7 0%, #0b8fe0 55%, #14b8c6 100%);
    color: #fff;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(11, 111, 224, .28);
    transition: transform .2s, box-shadow .2s, filter .2s;
}

.auth-btn:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 14px 30px rgba(11, 111, 224, .34); }
.auth-btn:focus { outline: none; box-shadow: 0 0 0 4px rgba(11, 111, 224, .25), 0 10px 24px rgba(11, 111, 224, .28); }
.auth-btn i { font-size: .85rem; transition: transform .2s; }
.auth-btn:hover i { transform: translateX(3px); }

.auth-register {
    margin: 24px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: .93rem;
    color: var(--muted);
}

.auth-register a {
    font-weight: 700;
    color: var(--brand);
}

.auth-register a:hover { color: var(--brand-dark); text-decoration: underline; }

.auth-secure {
    margin: 22px 0 0;
    font-size: .8rem;
    color: #8a99ad;
    text-align: center;
}

.auth-secure i { margin-right: 4px; }

/* ---------- Inscription ---------- */
.auth-card--wide { max-width: 680px; }
.auth-topbar--wide { max-width: 680px; }

.auth-topbar--wide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.auth-topbar-link {
    font-size: .88rem;
    color: var(--muted);
}

.auth-topbar .auth-topbar-link a {
    display: inline;
    color: var(--brand);
    font-weight: 700;
}

.auth-flow {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 6px;
    counter-reset: flow;
}

.auth-flow li {
    position: relative;
    display: flex;
    gap: 16px;
    padding-bottom: 18px;
}

.auth-flow li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 42px;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, .12);
}

.auth-flow-num {
    flex: 0 0 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: .92rem;
    color: var(--ink-900);
    background: var(--mint);
}

.auth-flow li:not(:first-child) .auth-flow-num {
    color: var(--mint);
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .16);
}

.auth-flow strong {
    display: block;
    font-size: .98rem;
    color: #fff;
}

.auth-flow small {
    display: block;
    margin-top: 2px;
    font-size: .85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, .62);
}

/* Indicateur d'étapes */
.reg-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    display: flex;
    gap: 8px;
}

.reg-steps li {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: .82rem;
    font-weight: 600;
    color: #8a99ad;
    text-align: left;
}

.reg-steps li::before {
    content: "";
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: #e3e9f2;
    transition: background-color .3s;
}

.reg-steps li span {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.reg-steps .lbl { font-style: normal; overflow: hidden; text-overflow: ellipsis; }

.reg-steps li b {
    flex: 0 0 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .74rem;
    background: #eef2f7;
    color: #8a99ad;
}

.reg-steps li.is-active,
.reg-steps li.is-done { color: var(--text); }
.reg-steps li.is-active::before { background: linear-gradient(90deg, #0b5ed7, #14b8c6); }
.reg-steps li.is-done::before { background: #0b8fe0; }
.reg-steps li.is-active b { background: var(--brand); color: #fff; }
.reg-steps li.is-done b { background: #d9ecfd; color: var(--brand); }

.reg-panel { display: none; }
.reg-panel.is-active { display: block; animation: reg-in .35s cubic-bezier(.22, 1, .36, 1); }

@keyframes reg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.reg-panel-head { margin-bottom: 20px; }

.reg-panel-head h2 {
    margin: 0 0 4px;
    font-family: var(--font);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}

.reg-panel-head p {
    margin: 0;
    font-size: .9rem;
    color: var(--muted);
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 16px;
}

.auth-optional {
    font-weight: 500;
    color: #8a99ad;
}

.auth-hint {
    display: block;
    margin-top: 6px;
    font-size: .8rem;
    color: #8a99ad;
}

.auth-ok {
    display: block;
    margin-top: 6px;
    font-size: .83rem;
    font-weight: 600;
    color: #138a4b;
}

.auth-input--plain { padding-left: 14px; }

/* Téléphone international */
.iti { width: 100%; }
.iti .auth-input { padding-right: 14px; }
.iti__country-list { z-index: 20; font-size: .9rem; }

/* Listes Selectize alignées sur les champs */
.auth-form .selectize-control { position: relative; }

.auth-form .selectize-control.single .selectize-input {
    min-height: 50px;
    padding: 14px 40px 14px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfcfe;
    box-shadow: none;
    font-family: var(--font);
    font-size: .98rem;
    color: var(--text);
}

.auth-form .selectize-control.single .selectize-input.input-active,
.auth-form .selectize-control.single .selectize-input.focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11, 111, 224, .12);
}

.auth-form .selectize-control.single .selectize-input::after { right: 16px; }
.auth-form .selectize-input input { font-family: var(--font); font-size: .98rem; }

.auth-form .selectize-dropdown {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 4px;
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(6, 20, 43, .12);
    font-family: var(--font);
    font-size: .93rem;
}

.auth-form .selectize-dropdown .active { background: #eef4fd; color: var(--brand); }

.auth-form select.input-validation-error + .selectize-control .selectize-input { border-color: var(--danger); }

/* Logo du cabinet */
.reg-file {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1.5px dashed #c9d5e4;
    border-radius: 14px;
    background: #fbfcfe;
    cursor: pointer;
    transition: border-color .2s, background-color .2s;
}

.reg-file:hover, .reg-file.is-dragover { border-color: var(--brand); background: #f3f8fe; }

.reg-file input[type=file] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.reg-file-thumb {
    flex: 0 0 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #eaf2fd;
    color: var(--brand);
    font-size: 1.2rem;
}

.reg-file-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

.reg-file-text { min-width: 0; }

.reg-file-text strong {
    display: block;
    font-size: .92rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reg-file-text small { font-size: .8rem; color: #8a99ad; }

.auth-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.auth-actions .auth-btn { flex: 1 1 auto; width: auto; }

.auth-btn--ghost {
    flex: 0 0 auto !important;
    padding: 0 22px;
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}

.auth-btn--ghost:hover { filter: none; background: #f4f7fb; box-shadow: none; }
.auth-btn--ghost:focus { box-shadow: 0 0 0 4px rgba(11, 111, 224, .15); }
.auth-btn--ghost:hover i { transform: translateX(-3px); }

.auth-btn[disabled] { opacity: .75; cursor: wait; transform: none; }

.auth-legal {
    margin: 16px 0 0;
    font-size: .8rem;
    line-height: 1.5;
    color: #8a99ad;
    text-align: center;
}

/* Pages de confirmation (inscription réussie, e-mail confirmé) */
.auth-shell--center .auth-main { justify-content: center; min-height: 100vh; }

.auth-status-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    color: #fff;
    background: linear-gradient(135deg, #0b5ed7, #14b8c6);
    box-shadow: 0 12px 28px rgba(11, 111, 224, .28);
}

.auth-status-icon--success { background: linear-gradient(135deg, #0f9d58, #14b8a6); box-shadow: 0 12px 28px rgba(20, 184, 166, .3); }

.auth-card .auth-sub strong { color: var(--text); overflow-wrap: anywhere; }

.auth-next {
    list-style: none;
    margin: 0 0 24px;
    padding: 16px 18px;
    border-radius: 14px;
    background: #f4f7fb;
    text-align: left;
    display: grid;
    gap: 12px;
}

.auth-next li {
    display: flex;
    gap: 12px;
    font-size: .9rem;
    line-height: 1.5;
    color: var(--muted);
}

.auth-next li i {
    flex: 0 0 18px;
    margin-top: 3px;
    color: var(--brand);
}

.auth-next li strong { color: var(--text); }

a.auth-btn, a.auth-btn:hover { color: #fff; text-decoration: none; }

/* ---------- Responsive ---------- */
@media (min-width: 576px) {
    .auth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-grid .span-2 { grid-column: 1 / -1; }
}

@media (min-width: 992px) {
    .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); }
    .auth-shell--register { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
    .auth-shell--register .auth-brand {
        position: sticky;
        top: 0;
        height: 100vh;
        align-self: start;
    }
    .auth-shell--center { grid-template-columns: minmax(0, 1fr); }
    .auth-brand { display: flex; }
    .auth-shell--center .auth-brand { display: none; }
    .auth-main { padding: 28px 40px; justify-content: center; }
    .auth-topbar { max-width: 440px; }
    .auth-topbar--wide { max-width: 680px; }
}

@media (max-width: 575.98px) {
    .auth-main { padding: 14px 16px 24px; }
    .auth-card {
        padding: 28px 20px 24px;
        border-radius: 18px;
        box-shadow: 0 10px 30px rgba(6, 20, 43, .06);
    }
    .auth-logo img { height: 80px; }
    .auth-card h1 { font-size: 1.4rem; }
    .auth-topbar-link { display: none; }
    .reg-steps li:not(.is-active) .lbl { display: none; }
    .reg-steps li.is-active { flex-grow: 2.4; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-btn, .auth-btn i, .auth-input { transition: none; }
    .reg-panel.is-active { animation: none; }
}
