/* ============================================================
   auth.css — Pages Login & Signup · Kaymwen
   Design: Organic Luxury / Editorial Warmth
   Modifié : arc de cercle de la même couleur que le formulaire (blanc)
   Version mobile/desktop distincte
   ============================================================ */

/* ── VARIABLES ── */
:root {
    --green-deep:   #1c3d35;
    --green-mid:    #2A5C54;
    --green-light:  #e6f0ee;
    --cream:        #faf7f2;
    --sand:         #f2ece3;
    --terracotta:   #c96b3a;
    --text-dark:    #1a1a1a;
    --text-mid:     #555;
    --text-soft:    #888;
    --border-light: #ede9e2;
    --card-bg:      #ffffff;
    --radius:       16px;
    --radius-sm:    10px;
    --radius-input: 12px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overscroll-behavior: none;
}

/* ── PAGE ENTRY ANIMATION ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── AUTH SECTION (mobile first) ── */
.auth-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HERO PANEL (mobile) ── */
.auth-hero {
    position: relative;
    height: 140px;
    background: var(--green-deep);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(28,61,53,0.15);
}

/* Arc de cercle inférieur (mobile) - couleur identique au formulaire */
.auth-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--cream); /* blanc pour s'harmoniser avec le formulaire */
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: scaleX(1.02);
    pointer-events: none;
    z-index: 2;
}

/* Atmospheric overlays */
.auth-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 5% 120%, rgba(201,107,58,0.20) 0%, transparent 60%),
        radial-gradient(ellipse 50% 70% at 95% -5%, rgba(255,255,255,0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

/* Decorative rings */
.hero-rings {
    position: absolute;
    right: -40px;
    bottom: 20px;
    width: 220px;
    height: 220px;
    opacity: 0.04;
    pointer-events: none;
    z-index: 1;
}

/* Logo inside hero */
.auth-hero-inner {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: row;        /* modifié : alignement horizontal */
    align-items: center;        /* centrage vertical */
    justify-content: center;    /* centrage horizontal du groupe */
    padding-top: 1.5rem;
    gap: 0.55rem;
}

.auth-logo-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255,255,255,0.11);
    border: 1.5px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.92);
    font-size: 1.25rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* ── SCROLL CONTAINER (mobile) ── */
.auth-container {
    flex: 1;
    padding: 0 1rem 2rem;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    animation: fadeUp 0.55s 0.05s ease both;
    background: var(--cream);
}

/* ── PAGE HEADINGS (mobile) ── */
.auth-header {
    padding: 1.5rem 0 1.2rem;
    text-align: center;
}

.auth-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.4rem;
    font-weight: 600;
    font-style: italic;
    color: var(--text-dark);
    line-height: 1.05;
    margin-bottom: 0.4rem;
    letter-spacing: -0.01em;
}

.auth-title .accent-dot {
    color: var(--terracotta);
    font-style: normal;
}

.auth-subtitle {
    font-family: 'Outfit', sans-serif;
    font-size: 0.87rem;
    color: var(--text-soft);
    font-weight: 400;
    line-height: 1.55;
}

/* ── FORM CARD ── */
.auth-form-card {
    background: var(--card-bg);
    border: 1.5px solid var(--border-light);
    border-radius: 20px;
    padding: 1.6rem 1.35rem 1.4rem;
    box-shadow:
        0 2px 6px rgba(28,61,53,0.04),
        0 8px 32px rgba(28,61,53,0.07);
    margin-bottom: 1.1rem;
}

/* ── FORM STRUCTURE ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.1rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* ── LABELS ── */
.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-mid);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.form-label a {
    font-size: 0.75rem;
    color: var(--terracotta);
    text-decoration: none;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    transition: opacity 0.2s;
}
.form-label a:hover { opacity: 0.7; }

/* ── INPUTS ── */
.auth-input {
    width: 100%;
    padding: 0.78rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--text-dark);
    background: var(--cream);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-input);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input::placeholder { color: #c2bdb5; font-weight: 300; }

.auth-input:focus {
    border-color: var(--green-mid);
    background: #fff;
    box-shadow: 0 0 0 3.5px rgba(42,92,84,0.11);
}

.auth-input.input-error {
    border-color: #d9534f;
    background: #fff9f8;
}
.auth-input.input-error:focus {
    border-color: #d9534f;
    box-shadow: 0 0 0 3px rgba(217,83,79,0.12);
}

/* ── ERROR MESSAGE ── */
.error-message {
    font-size: 0.73rem;
    color: #c94040;
    margin-top: 0.32rem;
    padding-left: 0.05rem;
    display: flex;
    align-items: center;
    gap: 0.28rem;
    line-height: 1.35;
}

.error-message::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    background: #c94040;
    color: #fff;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

/* ── REMEMBER / OPTIONS ── */
.form-options {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
    margin-top: -0.15rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.remember-me input[type="checkbox"] {
    width: 16px; height: 16px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--green-mid);
    flex-shrink: 0;
}

.remember-me label {
    font-size: 0.82rem;
    color: var(--text-mid);
    cursor: pointer;
}

/* ── TERMS CHECKBOX ── */
.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.terms-row input[type="checkbox"] {
    width: 16px; height: 16px;
    margin-top: 2px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--green-mid);
    flex-shrink: 0;
}

.terms-row label {
    font-size: 0.78rem;
    color: var(--text-mid);
    line-height: 1.5;
}

.terms-row label a {
    color: var(--green-mid);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: rgba(42,92,84,0.4);
}

/* ── SUBMIT BUTTON ── */
.btn-submit {
    width: 100%;
    padding: 0.95rem 1.5rem;
    background: var(--green-deep);
    color: #fff;
    border: none;
    border-radius: var(--radius-input);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: 1.3rem;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 3px 10px rgba(28,61,53,0.20),
        0 8px 24px rgba(28,61,53,0.14);
    transition: background 0.22s, transform 0.14s, box-shadow 0.22s;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 55%);
    pointer-events: none;
}

.btn-submit:hover {
    background: var(--green-mid);
    box-shadow: 0 5px 20px rgba(28,61,53,0.28), 0 2px 8px rgba(28,61,53,0.15);
}

.btn-submit:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(28,61,53,0.16);
}

.btn-submit i { font-size: 0.88rem; opacity: 0.82; }

/* ── DIVIDER ── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 1.15rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.auth-divider span {
    font-size: 0.72rem;
    color: var(--text-soft);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

/* ── GOOGLE BUTTON ── */
.btn-google {
    width: 100%;
    padding: 0.82rem 1.5rem;
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-input);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    transition: background 0.2s, border-color 0.2s, transform 0.14s;
}

.btn-google:hover { background: var(--sand); border-color: #ddd5c8; }
.btn-google:active { transform: scale(0.98); }

.btn-google svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ── FOOTER ── */
.auth-footer {
    text-align: center;
    padding-top: 0.2rem;
}

.auth-footer p {
    font-size: 0.84rem;
    color: var(--text-soft);
}

.auth-footer a {
    color: var(--terracotta);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}
.auth-footer a:hover { opacity: 0.72; }

/* ── SERVER ERROR BANNER ── */
.auth-error-banner {
    background: #fef3f1;
    border: 1.5px solid #f5cdc8;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: #b03a2e;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
    line-height: 1.45;
}
.auth-error-banner i { flex-shrink: 0; margin-top: 2px; }

/* ── STAGGERED FADE-UP for form items ── */
.auth-form-card .form-row { animation: fadeUp 0.4s 0.12s ease both; }
.auth-form-card .form-group:nth-child(1) { animation: fadeUp 0.4s 0.12s ease both; }
.auth-form-card .form-group:nth-child(2) { animation: fadeUp 0.4s 0.18s ease both; }
.auth-form-card .form-group:nth-child(3) { animation: fadeUp 0.4s 0.24s ease both; }
.auth-form-card .form-group:nth-child(4) { animation: fadeUp 0.4s 0.30s ease both; }
.auth-form-card .form-group:nth-child(5) { animation: fadeUp 0.4s 0.36s ease both; }
.btn-submit { animation: fadeUp 0.4s 0.38s ease both; }

/* ── DESKTOP SPLIT LAYOUT (min-width: 900px) ── */
@media (min-width: 900px) {
    .auth-section {
        flex-direction: row;
        min-height: 100vh;
    }

    /* Left: sticky green panel */
    .auth-hero {
        position: sticky;
        top: 0;
        width: 42%;
        min-width: 320px;
        height: 100vh;
        flex-shrink: 0;
        overflow: hidden;
        border-radius: 0;
    }

    /* Arc latéral droit (desktop) - même couleur que le formulaire */
    .auth-hero::after {
        top: 0;
        bottom: 0;
        left: auto;
        right: -1px;
        width: 50px;
        height: auto;
        border-radius: 0 50% 50% 0 / 0 100% 100% 0;
        transform: scaleY(1.02);
        background: var(--cream); /* blanc */
    }

    .auth-hero-inner {
        padding-top: 0;
        height: 100%;
        justify-content: center;
        gap: 0.7rem;
        flex-direction: row;        /* maintien du row en desktop */
    }

    .auth-hero-tagline {
        display: block;
    }

    /* Right: scrollable content */
    .auth-container {
        flex: 1;
        padding: 0 4rem 3rem 5rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        animation: none;
        min-height: 100vh;
        max-width: none;
    }

    .auth-header {
        padding-top: 0;
    }

    .auth-title {
        font-size: 3.2rem;
    }
}

/* ── HERO TAGLINE (desktop only) ── */
.auth-hero-tagline {
    display: none;
    position: absolute;
    bottom: 3.5rem;
    left: 2.5rem;
    right: 3rem;
    z-index: 3;
}

.hero-tagline-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    font-style: italic;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
}

.hero-tagline-text strong {
    color: rgba(255,255,255,0.9);
    font-style: normal;
    font-weight: 600;
}
/* ── KAYMWEN SVG LOGO ── */
.auth-logo-svg {
    height: 70px;
    width: auto;
    max-width: 600px;
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.12));
}

@media (min-width: 900px) {
    .auth-logo-svg {
        height: 70px;
    }
}