/* Pages de connexion / inscription — responsive professionnel */

.auth-violet-bg {
    position: relative;
    isolation: isolate;
    background-color: #001433;
    background-image:
        radial-gradient(ellipse 90% 55% at 50% -5%, rgba(212, 175, 55, 0.18) 0%, transparent 58%),
        radial-gradient(ellipse 45% 35% at 100% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 55%),
        radial-gradient(ellipse 40% 30% at 0% 100%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        linear-gradient(160deg, #000d26 0%, #001a4d 28%, #002366 55%, #003087 82%, #0047ab 100%);
}

.auth-violet-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(125deg, transparent 42%, rgba(212, 175, 55, 0.14) 50%, transparent 58%),
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, 0.015) 0,
            rgba(255, 255, 255, 0.015) 1px,
            transparent 1px,
            transparent 10px
        );
    pointer-events: none;
}

.auth-page__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    margin-inline: auto;
}

.auth-page {
    display: flex;
    min-height: 100dvh;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    overflow-x: hidden;
}

.auth-page__inner--md {
    max-width: 28rem;
}

.auth-page__inner--lg {
    max-width: 42rem;
}

.auth-page__inner--xl {
    max-width: 56rem;
}

.auth-card {
    width: 100%;
    max-width: 100%;
    border-top: 3px solid #d4af37;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 20px 45px rgba(0, 26, 77, 0.22);
    padding: clamp(1rem, 4vw, 2rem);
}

.auth-card__title {
    font-size: clamp(1.25rem, 4.5vw, 1.5rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.25;
}

.auth-card__subtitle {
    margin-top: 0.5rem;
    font-size: clamp(0.8125rem, 3vw, 0.875rem);
    color: #4b5563;
    line-height: 1.45;
}

.auth-lang-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.625rem 0.875rem;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.55);
    border-radius: 0.75rem;
    box-shadow:
        0 10px 28px rgba(0, 10, 40, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.auth-lang-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #003087;
    white-space: nowrap;
}

.auth-lang-label svg {
    width: 1rem;
    height: 1rem;
    color: #d4af37;
    flex-shrink: 0;
}

.auth-lang-form {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

.auth-lang-select {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23003087'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    background-size: 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-lang-select:hover {
    border-color: #d4af37;
}

.auth-lang-select:focus {
    outline: none;
    border-color: #0047ab;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.35);
}

@media (min-width: 480px) {
    .auth-lang-select {
        width: auto;
        min-width: 11.5rem;
        max-width: 16rem;
    }
}

.auth-field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.auth-input {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #111827;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus {
    outline: none;
    border-color: #0047ab;
    box-shadow: 0 0 0 2px rgba(0, 71, 171, 0.25);
}

.auth-input-wrap {
    position: relative;
    min-width: 0;
}

.auth-input-icon {
    position: absolute;
    inset-block: 0;
    left: 0.75rem;
    display: flex;
    align-items: center;
    pointer-events: none;
    color: #9ca3af;
}

.auth-input-icon--top {
    align-items: flex-start;
    padding-top: 0.85rem;
}

.auth-textarea {
    min-height: 5rem;
    resize: vertical;
}

.auth-select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1rem;
}

.auth-password-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.5rem;
}

.auth-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.auth-btn:hover {
    filter: brightness(1.05);
}

@media (min-width: 768px) {
    .auth-btn:hover {
        transform: translateY(-1px);
    }
}

.auth-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    min-width: 0;
}

@media (min-width: 768px) {
    .auth-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.auth-alert {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    line-height: 1.45;
    border-radius: 0.375rem;
    word-break: break-word;
}

.auth-footer {
    padding-top: 1rem;
    margin-top: 0.5rem;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #4b5563;
}

/* Logo auth — adapté à la largeur de la carte, pas du viewport */
.site-logo--auth .site-logo__img {
    height: clamp(3.25rem, 20vw, 4.75rem);
    width: auto;
    max-width: min(100%, 18rem);
    min-width: 0;
    background: transparent;
    border-radius: 0;
}

.site-logo--auth {
    padding: 0;
}

.site-logo__tagline {
    margin-top: 0.75rem;
    font-size: clamp(0.75rem, 3vw, 0.875rem);
    padding-inline: 0.5rem;
}

.auth-header {
    margin-bottom: clamp(1rem, 4vw, 2rem);
}

@media (max-width: 380px) {
    .auth-page {
        padding-inline: 0.75rem;
    }

    .auth-card {
        padding: 0.875rem;
        border-radius: 0.875rem;
    }
}

/* ========== Inscription premium — wizard ========== */

.auth-register {
    display: grid;
    gap: 0;
    width: 100%;
    min-width: 0;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow:
        0 32px 64px rgba(0, 13, 38, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

@media (min-width: 900px) {
    .auth-register {
        grid-template-columns: 0.9fr 1.1fr;
        min-height: 36rem;
    }
}

.auth-register__aside {
    display: none;
    position: relative;
    background: linear-gradient(165deg, #000d26 0%, #001a4d 45%, #003087 100%);
    color: #fff;
    overflow: hidden;
}

@media (min-width: 900px) {
    .auth-register__aside {
        display: block;
    }
}

.auth-register__aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 80% 15%, rgba(212, 175, 55, 0.22) 0%, transparent 45%),
        radial-gradient(circle at 10% 85%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
    pointer-events: none;
}

.auth-register__aside-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 2.5rem 2rem;
}

.auth-register__tagline {
    margin: 1rem 0 2rem;
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
}

.auth-register__benefits {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-register__benefits li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.9);
}

.auth-register__benefits svg {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    margin-top: 0.125rem;
    color: #fbbf24;
}

.auth-register__main {
    min-width: 0;
    background: #fff;
}

.auth-card--wizard {
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    padding: clamp(1.25rem, 4vw, 2rem);
    min-height: 100%;
}

.auth-card__mobile-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

@media (min-width: 900px) {
    .auth-card__mobile-brand {
        display: none;
    }
}

.reg-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
    position: relative;
}

.reg-stepper::before {
    content: "";
    position: absolute;
    top: 1.125rem;
    left: 12%;
    right: 12%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}

.reg-stepper__item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    min-width: 0;
}

.reg-stepper__dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #64748b;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    transition: all 0.25s ease;
}

.reg-stepper__item.is-active .reg-stepper__dot {
    color: #fff;
    background: linear-gradient(135deg, #003087, #0047ab);
    border-color: #003087;
    box-shadow: 0 4px 14px rgba(0, 48, 135, 0.35);
}

.reg-stepper__item.is-complete .reg-stepper__dot {
    color: #fff;
    background: #059669;
    border-color: #059669;
}

.reg-stepper__text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
    padding: 0 0.25rem;
}

.reg-stepper__title {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.reg-stepper__item.is-active .reg-stepper__title {
    color: #003087;
}

.reg-stepper__desc {
    font-size: 0.625rem;
    color: #64748b;
    line-height: 1.25;
}

@media (max-width: 639px) {
    .reg-stepper__desc {
        display: none;
    }

    .reg-stepper__dot {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
}

.reg-panel__head {
    margin-bottom: 1.5rem;
}

.reg-panel__title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 800;
    color: #001a4d;
    letter-spacing: -0.02em;
}

.reg-panel__subtitle {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: #64748b;
}

.reg-field {
    margin-bottom: 1.25rem;
}

.reg-required {
    color: #dc2626;
}

.reg-email-row {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

@media (min-width: 480px) {
    .reg-email-row {
        flex-direction: row;
        align-items: stretch;
    }

    .reg-email-row__input {
        flex: 1;
        min-width: 0;
    }
}

.reg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 0.625rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    white-space: nowrap;
}

.reg-btn svg {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
}

.reg-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.reg-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #003087, #0047ab);
    box-shadow: 0 4px 14px rgba(0, 48, 135, 0.3);
}

.reg-btn--primary:not(:disabled):hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.reg-btn--secondary {
    color: #fff;
    background: linear-gradient(135deg, #475569, #334155);
    flex-shrink: 0;
}

.reg-btn--secondary:not(:disabled):hover {
    filter: brightness(1.08);
}

.reg-btn--outline {
    color: #003087;
    background: #fff;
    border-color: #cbd5e1;
}

.reg-btn--outline:not(:disabled):hover {
    background: #f8fafc;
    border-color: #003087;
}

.reg-btn--gold {
    color: #001a4d;
    background: linear-gradient(135deg, #fde68a, #d4af37);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
}

.reg-btn--gold:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.reg-otp {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
}

.reg-otp__intro {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #475569;
}

.reg-otp__digits {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reg-otp__digit {
    width: 2.75rem;
    height: 3.25rem;
    padding: 0;
    font-size: 1.375rem;
    font-weight: 700;
    text-align: center;
    color: #001a4d;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 0.625rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.reg-otp__digit:focus {
    outline: none;
    border-color: #0047ab;
    box-shadow: 0 0 0 3px rgba(0, 71, 171, 0.2);
}

.reg-otp__digit.is-valid {
    border-color: #059669;
    background: #ecfdf5;
}

.reg-otp__error {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: #dc2626;
    text-align: center;
}

.reg-otp__hint {
    margin: 0.625rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
    text-align: center;
}

.reg-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.reg-nav .reg-btn--primary,
.reg-nav .reg-btn--gold {
    margin-left: auto;
}

.auth-alert--error {
    margin-bottom: 1.25rem;
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.auth-alert--success {
    margin-bottom: 1.25rem;
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

/* ========== Connexion premium — split layout ========== */

.auth-register--login {
    min-height: auto;
}

@media (min-width: 900px) {
    .auth-register--login {
        min-height: 32rem;
    }
}

.auth-card--login {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.reg-panel__head--login {
    margin-bottom: 1.5rem;
}

.reg-panel__head--login .reg-panel__title {
    margin: 0;
    font-size: clamp(1.375rem, 4vw, 1.625rem);
    font-weight: 800;
    color: #0f172a;
}

.reg-panel__head--login .reg-panel__subtitle {
    margin: 0.375rem 0 0;
    font-size: 0.9375rem;
    color: #64748b;
}

.reg-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.reg-login-remember {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
}

.reg-login-remember input {
    width: 1rem;
    height: 1rem;
    accent-color: #003087;
}

.reg-btn--full {
    width: 100%;
    justify-content: center;
}

.auth-login-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-login-trust__item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.auth-login-trust__item svg {
    width: 0.875rem;
    height: 0.875rem;
    color: #fbbf24;
}

.reg-error-list {
    margin: 0;
    padding-left: 1.125rem;
}

.auth-footer--wizard {
    margin-top: 0;
    padding-top: 1.25rem;
    border-top: none;
}

@media (max-width: 899px) {
    .auth-register {
        border-radius: 1rem;
    }

    .auth-card--wizard {
        border-radius: 1rem;
    }

    .reg-nav {
        flex-wrap: wrap;
    }

    .reg-nav .reg-btn--outline {
        order: 1;
    }

    .reg-nav .reg-btn--primary,
    .reg-nav .reg-btn--gold {
        order: 2;
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 479px) {
    .reg-btn {
        white-space: normal;
    }

    .reg-email-row .reg-btn--secondary {
        width: 100%;
    }

    .reg-otp__digit {
        width: 2.375rem;
        height: 2.875rem;
        font-size: 1.125rem;
    }
}
