/* ==========================================================
   HNC Auth — Kayan Panel (Sign In / Sign Up Slide)
   Referans: Florin Pop "Sign in/Sign up" + HNC Premium Steel teması
   ----------------------------------------------------------
   - Mavi yerine HNC navy (#16202E) + champagne gold (#C9A76A)
   - .auth-card                : ana konteyner
   - .auth-card.is-register    : kayıt moduna geçiş (overlay sola, form sağa)
   - .auth-form--login         : sol form (giriş)
   - .auth-form--register      : sağ form (kayıt)
   - .auth-overlay-container   : kayan üst panel
   ==========================================================*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --auth-navy:        #16202E;
    --auth-navy-deep:   #0E1620;
    --auth-navy-soft:   #1F2C3F;
    --auth-cream:       #F4F1EA;
    --auth-cream-warm:  #EDE8DD;
    --auth-input-bg:    #F2EEE5;
    --auth-input-focus: #FBF8F1;
    --auth-text:        #16202E;
    --auth-text-muted:  #6E6A60;
    --auth-gold:        #C9A76A;
    --auth-gold-deep:   #B89455;
    --auth-danger:      #C25656;
    --auth-success:     #5FA767;
    --auth-info:        #6F94BF;
    --auth-radius:      14px;
    --auth-shadow:      0 24px 60px -12px rgba(14, 22, 32, 0.32),
                        0 10px 25px -10px rgba(14, 22, 32, 0.20);
    --auth-ease:        cubic-bezier(0.65, 0, 0.35, 1);
}

/* ---------- Page shell ---------- */
html, body { margin: 0; }

.auth-body {
    box-sizing: border-box;
    height: 100vh;             /* viewport'a sabitle, dış kaydırmayı engelle */
    overflow: hidden;
    overscroll-behavior: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(1200px 600px at 20% 10%, rgba(201, 167, 106, 0.10), transparent 60%),
        radial-gradient(900px 500px at 90% 90%, rgba(22, 32, 46, 0.08), transparent 60%),
        linear-gradient(135deg, #F6F2EA 0%, #EDE8DD 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Card ---------- */
.auth-card {
    position: relative;
    width: 100%;
    max-width: 1080px;
    height: 100%;              /* mevcut alanı doldur, viewport'a göre adapt */
    max-height: 760px;
    min-height: 0;
    background: #FFFFFF;
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    overflow: hidden;
    isolation: isolate;
}

/* ---------- Brand strip (top-left mini logo) ---------- */
.auth-brand {
    position: absolute;
    top: 22px;
    left: 28px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.5s var(--auth-ease);
}
.auth-brand img {
    height: 28px;
    width: auto;
    display: block;
}
.auth-brand-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--auth-navy);
    line-height: 1.2;
    white-space: nowrap;
}
/* Kayıt modunda sol form sağa kaydığında brand görünmesin */
.auth-card.is-register .auth-brand { opacity: 0; }

/* ---------- Form panels (taban) ---------- */
.auth-form-pane {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    display: flex;
    align-items: safe center;   /* sığmazsa üstten başlat, kırpma olmasın */
    justify-content: center;
    padding: 32px 56px;
    transition: transform 0.65s var(--auth-ease),
                opacity 0.5s var(--auth-ease);
    box-sizing: border-box;
    /* Kart küçük ekranda kısaldığında form içeriği taşarsa pane içeride kaysın,
       body asla kaymasın. */
    overflow-y: auto;
    overscroll-behavior: contain;
}
.auth-form-pane::-webkit-scrollbar { width: 0; height: 0; }
.auth-form-pane { scrollbar-width: none; }
/* Login formu — soldan giriyor */
.auth-form--login {
    left: 0;
    z-index: 2;
}
/* Register formu — soldan başlıyor (overlay altında saklı) */
.auth-form--register {
    left: 0;
    z-index: 1;
    opacity: 0;
}

/* Register modu aktifken */
.auth-card.is-register .auth-form--login {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}
.auth-card.is-register .auth-form--register {
    transform: translateX(100%);
    opacity: 1;
    z-index: 5;
    animation: authShow 0.6s var(--auth-ease);
}

@keyframes authShow {
    0%, 49.99% { opacity: 0; z-index: 1; }
    50%, 100%  { opacity: 1; z-index: 5; }
}

/* ---------- Form içerikleri ---------- */
.auth-form {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}
.auth-form-eyebrow {
    font-size: 11.5px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--auth-gold-deep);
    font-weight: 600;
    margin-bottom: -2px;
}
.auth-form-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    color: var(--auth-text);
    line-height: 1.15;
}
.auth-form-subtitle {
    font-size: 14px;
    line-height: 1.6;
    color: var(--auth-text-muted);
    margin: 0 0 8px;
}

/* Field */
.auth-field {
    text-align: left;
    width: 100%;
}
.auth-field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}
.auth-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-text);
    letter-spacing: 0.02em;
    margin-bottom: 6px;
}
.auth-input {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--auth-input-bg);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--auth-text);
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    outline: none;
}
.auth-input::placeholder { color: #B5B0A4; }
.auth-input:focus {
    background-color: var(--auth-input-focus);
    border-color: var(--auth-gold);
    box-shadow: 0 0 0 3px rgba(201, 167, 106, 0.15);
}
.auth-input.is-invalid {
    border-color: var(--auth-danger);
    box-shadow: 0 0 0 3px rgba(194, 86, 86, 0.12);
}
.auth-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--auth-danger);
    line-height: 1.4;
}
.auth-help {
    display: block;
    margin-top: 6px;
    font-size: 11.5px;
    color: var(--auth-text-muted);
}
.auth-helper-link {
    font-size: 12px;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color 0.18s ease;
}
.auth-helper-link:hover { color: var(--auth-gold-deep); }

/* Submit button */
.auth-submit {
    margin-top: 10px;
    appearance: none;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--auth-navy) 0%, var(--auth-navy-soft) 100%);
    color: #FFFFFF;
    border-radius: 999px;
    padding: 13px 28px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-family: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    box-shadow: 0 8px 18px -8px rgba(14, 22, 32, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -10px rgba(14, 22, 32, 0.55);
    filter: brightness(1.06);
}
.auth-submit:active { transform: translateY(0); }

/* Inline alerts */
.auth-alert {
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    margin-bottom: 6px;
}
.auth-alert.is-error   { background: rgba(194, 86, 86, 0.10);  color: #8E3535; border: 1px solid rgba(194, 86, 86, 0.25); }
.auth-alert.is-success { background: rgba(95, 167, 103, 0.10); color: #2F6F36; border: 1px solid rgba(95, 167, 103, 0.25); }
.auth-alert.is-info    { background: rgba(111, 148, 191, 0.10); color: #2F4F75; border: 1px solid rgba(111, 148, 191, 0.25); }

/* ---------- Overlay (kayan navy panel) ---------- */
.auth-overlay-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 50%;
    height: 100%;
    overflow: hidden;
    transition: transform 0.65s var(--auth-ease);
    z-index: 4;
    pointer-events: none;
}
.auth-card.is-register .auth-overlay-container {
    transform: translateX(-100%);
}

.auth-overlay {
    position: relative;
    left: -100%;
    height: 100%;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.65s var(--auth-ease);
    background:
        radial-gradient(800px 500px at 20% 20%, rgba(201, 167, 106, 0.18), transparent 60%),
        radial-gradient(600px 400px at 90% 100%, rgba(244, 241, 234, 0.07), transparent 60%),
        linear-gradient(135deg, var(--auth-navy) 0%, var(--auth-navy-deep) 100%);
    color: var(--auth-cream);
    pointer-events: auto;
}
.auth-card.is-register .auth-overlay {
    transform: translateX(50%);
}

/* Overlay'in iki yarısı (sol = login modunda görünür, sağ = register modunda görünür) */
.auth-overlay-pane {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 56px;
    box-sizing: border-box;
    text-align: center;
    transform: translateX(0);
    transition: transform 0.65s var(--auth-ease);
}
.auth-overlay-pane--left  { left: 0;   transform: translateX(-20%); }
.auth-overlay-pane--right { right: 0;  transform: translateX(0); }

.auth-card.is-register .auth-overlay-pane--left  { transform: translateX(0); }
.auth-card.is-register .auth-overlay-pane--right { transform: translateX(20%); }

/* Overlay içeriği */
.auth-overlay-eyebrow {
    font-size: 11px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--auth-gold);
    font-weight: 600;
    margin-bottom: 14px;
}
.auth-overlay-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.1;
    color: #FFFFFF;
}
.auth-overlay-title .accent {
    color: var(--auth-gold);
    font-style: italic;
}
.auth-overlay-text {
    font-size: 14px;
    line-height: 1.65;
    color: rgba(244, 241, 234, 0.80);
    margin: 0 0 26px;
    max-width: 320px;
}
.auth-overlay-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 26px;
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(244, 241, 234, 0.55);
}
.auth-overlay-stats strong {
    display: block;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0;
    color: var(--auth-gold);
    text-transform: none;
}
.auth-overlay-stats-sep {
    width: 1px;
    height: 28px;
    background: rgba(244, 241, 234, 0.20);
}

/* Ghost button on overlay */
.auth-ghost {
    appearance: none;
    background: transparent;
    color: #FFFFFF;
    border: 1.5px solid rgba(244, 241, 234, 0.85);
    border-radius: 999px;
    padding: 12px 38px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.20em;
    text-transform: uppercase;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.20s ease, border-color 0.20s ease, color 0.20s ease, transform 0.18s ease;
}
.auth-ghost:hover {
    background: var(--auth-gold);
    border-color: var(--auth-gold);
    color: var(--auth-navy);
    transform: translateY(-1px);
}

/* Microfooter inside form panel */
.auth-microfoot {
    margin-top: 22px;
    font-size: 11px;
    color: var(--auth-text-muted);
    letter-spacing: 0.04em;
    text-align: center;
}

/* ---------- Mobil yığma ---------- */
@media (max-width: 760px) {
    .auth-body {
        padding: 16px 12px;
        height: auto;
        min-height: 100vh;
        overflow: auto;       /* mobilde dikey kaydırma serbest */
    }
    .auth-card {
        height: auto;
        max-height: none;
        min-height: unset;
        max-width: 460px;
        overflow: visible;
    }

    /* Form panelleri statik akışa düşer */
    .auth-form-pane {
        position: static;
        width: 100%;
        padding: 80px 24px 28px;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        overflow: visible;
    }
    .auth-form--register { display: none; }
    .auth-card.is-register .auth-form--login    { display: none; }
    .auth-card.is-register .auth-form--register { display: flex; }

    /* Overlay tam genişlikte alt blok olur */
    .auth-overlay-container {
        position: static;
        width: 100%;
        height: auto;
        transform: none !important;
        background: var(--auth-navy);
        border-radius: 0 0 var(--auth-radius) var(--auth-radius);
    }
    .auth-overlay {
        position: static;
        width: 100%;
        left: 0;
        transform: none !important;
        padding: 28px 24px 32px;
    }
    .auth-overlay-pane {
        position: static;
        width: 100%;
        height: auto;
        padding: 0;
        transform: none !important;
    }
    .auth-card.is-register .auth-overlay-pane--right,
    .auth-overlay-pane--left {
        display: none;
    }
    /* Login modunda sağ pane (Hesap Oluştur CTA) görünür */
    .auth-overlay-pane--right { display: flex; }
    /* Register modunda sol pane (Tekrar Hoşgeldin CTA) görünür */
    .auth-card.is-register .auth-overlay-pane--left  { display: flex; }
    .auth-card.is-register .auth-overlay-pane--right { display: none; }

    .auth-brand {
        position: absolute;
        top: 18px;
        left: 50%;
        transform: translateX(-50%);
        opacity: 1 !important;
    }
    .auth-overlay-title { font-size: 26px; }
    .auth-form-title    { font-size: 26px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .auth-form-pane,
    .auth-overlay-container,
    .auth-overlay,
    .auth-overlay-pane,
    .auth-submit,
    .auth-ghost,
    .auth-input {
        transition: none !important;
        animation: none !important;
    }
}
