/* ---------------------------------------------------------------------------
 * auth.css — Styles partages pour les pages connexion et inscription
 * ---------------------------------------------------------------------------
 * Description : Feuille de style commune pour login.html et register.html.
 *   Layout split-screen desktop (carousel gauche + formulaire droite),
 *   full-screen formulaire sur mobile avec logo en haut.
 *
 * Contexte & Workflow : Charge par les templates Jinja2 auth/login.html
 *   et auth/register.html via /static/css/auth.css.
 *
 * Prerequis : Polices Inter et Fraunces chargees depuis /static/fonts/.
 *
 * Usage : <link rel="stylesheet" href="/static/css/auth.css">
 * --------------------------------------------------------------------------- */

/* --- Reset & base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: #0A1220;
    color: #F0EDE6;
}

body {
    background:
        radial-gradient(60% 50% at 30% 30%, rgba(201,169,97,.06), transparent 65%),
        radial-gradient(50% 40% at 80% 70%, rgba(126,168,211,.04), transparent 60%),
        #0A1220;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlide {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes carouselFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Card container --- */
.auth-card {
    width: 100%;
    max-width: 1180px;
    min-height: min(720px, 92vh);
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: rgba(15,27,45,.85);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 0 1px rgba(201,169,97,.05);
    backdrop-filter: blur(20px);
    padding: 8px;
}

/* --- Left panel (carousel) --- */
.auth-hero {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: #0E1A2E;
    display: flex;
    flex-direction: column;
    padding: 24px 28px;
}

.auth-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: opacity 1s ease;
}

.auth-hero__bg--active { opacity: 1; }
.auth-hero__bg--hidden { opacity: 0; }

.auth-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        rgba(10,18,30,.45) 0%,
        rgba(10,18,30,.2) 35%,
        rgba(10,18,30,.55) 70%,
        rgba(10,18,30,.85) 100%
    );
}

.auth-hero__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 5;
}

.auth-hero__spacer { flex: 1; }

.auth-hero__caption {
    position: relative;
    z-index: 2;
    animation: fadeIn .6s ease .15s both;
}

.auth-hero__title {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 2.0rem;
    line-height: 1.1;
    color: #F0EDE6;
    max-width: 500px;
}

/* --- Carousel dots --- */
.auth-dots {
    display: flex;
    gap: 8px;
    margin-top: 24px;
    align-items: center;
}

.auth-dot {
    height: 4px;
    border-radius: 999px;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all .35s ease;
    background: rgba(240,237,230,.3);
    width: 18px;
}

.auth-dot--active {
    background: rgba(240,237,230,.95);
    width: 28px;
}

/* --- Logo --- */
.auth-logo {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
}

.auth-logo__text {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: 1.5rem;
    color: #F0EDE6;
    letter-spacing: -0.02em;
}

/* --- Back link (hero) --- */
.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(255,255,255,.13);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.15);
    color: #F0EDE6;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 500;
    transition: all .2s;
}
.auth-back:hover {
    background: rgba(255,255,255,.2);
    transform: translateX(2px);
}

/* --- Right panel (form) --- */
.auth-form-panel {
    flex: 1;
    padding: 42px 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: fadeIn .4s ease both;
    overflow-y: auto;
}

.auth-form-inner {
    animation: fadeIn .35s ease both;
}

/* --- Mobile logo (hidden on desktop) --- */
.auth-mobile-logo {
    display: none;
    margin-bottom: 32px;
}

/* --- Headings --- */
.auth-heading {
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 5px;
    color: #F0EDE6;
}

.auth-heading em {
    color: #C9A961;
    font-style: italic;
}

.auth-heading-spacer { height: 32px; }

/* --- Error --- */
.auth-error {
    background: rgba(244,67,54,.12);
    border: 1px solid rgba(244,67,54,.35);
    color: #ef9a9a;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: .88rem;
    animation: fadeIn .3s ease both;
}

/* --- Form --- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* --- Input field --- */
.auth-field {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    color: #F0EDE6;
    font-size: .88rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.auth-input:focus {
    border-color: rgba(201,169,97,.5);
    box-shadow: 0 0 0 3px rgba(201,169,97,.08);
}

.auth-input::placeholder {
    color: rgba(240,237,230,.35);
}

.auth-input--password {
    padding-right: 44px;
}

/* --- Password toggle --- */
.auth-pwd-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: rgba(240,237,230,.45);
    display: flex;
    align-items: center;
    transition: color .2s;
}
.auth-pwd-toggle:hover {
    color: #C9A961;
}

/* --- Row: checkbox + link --- */
.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

/* --- Checkbox --- */
.auth-check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.auth-check__box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    flex-shrink: 0;
    padding: 0;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.auth-check__box--checked {
    background: #C9A961;
    border-color: #C9A961;
}

.auth-check__label {
    font-size: .82rem;
    color: rgba(240,237,230,.6);
}

.auth-check__label a {
    color: #F0EDE6;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Forgot password --- */
.auth-forgot {
    font-size: .82rem;
    color: rgba(240,237,230,.55);
    text-decoration: none;
    transition: color .2s;
}
.auth-forgot:hover { color: #C9A961; }

/* --- Submit button --- */
.auth-submit {
    margin-top: 18px;
    padding: 14px 22px;
    border-radius: 12px;
    background: #C9A961;
    color: #1A2332;
    font-weight: 600;
    font-size: .92rem;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 6px 20px rgba(201,169,97,.28);
    transition: all .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.auth-submit:hover {
    box-shadow: 0 10px 30px rgba(201,169,97,.4);
    transform: translateY(-1px);
}

.auth-submit:disabled {
    background: rgba(201,169,97,.4);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* --- Trial hint --- */
.auth-trial-hint {
    text-align: center;
    margin-top: 14px;
    font-size: .78rem;
    color: rgba(240,237,230,.4);
}

/* --- Switch mode --- */
.auth-switch {
    margin-top: 24px;
    font-size: .85rem;
    color: rgba(240,237,230,.55);
    text-align: center;
}

.auth-switch a {
    color: #C9A961;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

/* --- Footer --- */
.auth-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-footer__secure {
    font-size: .75rem;
    color: rgba(240,237,230,.32);
    display: flex;
    align-items: center;
    gap: 7px;
}

.auth-footer__help {
    font-size: .75rem;
    color: rgba(240,237,230,.32);
    text-decoration: none;
    transition: color .2s;
}
.auth-footer__help:hover {
    color: rgba(240,237,230,.6);
}


/* =============================================
   CAROUSEL BACKGROUND PATTERNS (SVG gradients)
   ============================================= */

.auth-hero__bg-pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: opacity 1s ease;
}

.auth-hero__bg-pattern--0 {
    background: url('/static/img/auth/slide-0.jpg') center/cover no-repeat;
}

.auth-hero__bg-pattern--1 {
    background: url('/static/img/auth/slide-1.jpg') center/cover no-repeat;
}

.auth-hero__bg-pattern--2 {
    background: url('/static/img/auth/slide-2.jpg') center/cover no-repeat;
}


/* =============================================
   RESPONSIVE — Mobile
   ============================================= */

@media (max-width: 768px) {
    body {
        padding: 16px;
        align-items: center;
    }

    .auth-card {
        grid-template-columns: 1fr;
        min-height: auto;
        max-width: 480px;
        border-radius: 24px;
        padding: 6px;
    }

    /* Hide hero panel on mobile */
    .auth-hero {
        display: none;
    }

    /* Show mobile logo */
    .auth-mobile-logo {
        display: flex;
    }

    .auth-form-panel {
        padding: 28px 24px;
        justify-content: flex-start;
    }

    .auth-heading {
        font-size: 1.65rem;
    }

    .auth-form-row {
        grid-template-columns: 1fr;
    }

    .auth-footer {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
}

@media (max-width: 400px) {
    .auth-form-panel {
        padding: 24px 18px;
    }
}