/* Nar OSGB giris ekrani: tam ekran Three.js sahnesi (nar-login-scene.js) + sagda form karti. */
:root {
    --nar-red: #e30613;
    --nar-red-dark: #b3050f;
    --nar-red-soft: #ff4d57;
    --nar-amber: #ffa630;
    --nar-night: #0c0305;
    --nar-ink: #1a1014;
    --nar-muted: #6b5a5f;
    --nar-line: #eee4e5;
    --nar-field: #faf6f6;
    --nar-card: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    color: var(--nar-ink);
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse 70% 60% at 32% 46%, rgba(160, 8, 24, 0.38) 0%, rgba(70, 4, 12, 0.22) 38%, transparent 70%),
        radial-gradient(ellipse 90% 70% at 50% 110%, rgba(120, 10, 20, 0.35) 0%, transparent 60%),
        var(--nar-night);
    background-attachment: fixed;
}

/* ---------- Sahne ---------- */
#narScene {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: block;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}
#narScene.is-live { opacity: 1; }

/* Kenarlari karartan vinyet, metin okunurlugunu artirir */
.nar-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 120% 90% at 35% 45%, transparent 55%, rgba(5, 1, 2, 0.65) 100%),
        linear-gradient(180deg, transparent 60%, rgba(5, 1, 2, 0.55) 100%);
}

/* ---------- Yerlesim ---------- */
.login-container {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.nar-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 48px 56px;
    color: #fbeff0;
    pointer-events: none;
}

.nar-hero__eyebrow {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--nar-red-soft);
    margin-bottom: 10px;
}

.nar-hero h1 {
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.nar-hero__lead {
    max-width: 440px;
    font-size: 0.98rem;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(251, 239, 240, 0.78);
}

.nar-legend {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-top: 22px;
    font-size: 0.8rem;
    color: rgba(251, 239, 240, 0.7);
}
.nar-legend li { display: flex; align-items: center; gap: 8px; }
.nar-legend i {
    width: 9px; height: 9px; border-radius: 50%;
    display: inline-block; flex: none;
}
.nar-legend .is-shell { border: 2px solid var(--nar-red-soft); }
.nar-legend .is-aril { background: #d0102a; box-shadow: 0 0 8px rgba(255, 60, 80, 0.8); }
.nar-legend .is-risk { background: var(--nar-amber); box-shadow: 0 0 8px rgba(255, 166, 48, 0.8); }

.nar-hero, .nar-card { opacity: 0; animation: narRise 0.9s cubic-bezier(.2, .7, .2, 1) forwards; }
.nar-hero { animation-delay: 1.6s; }
.nar-card { animation-delay: 0.5s; }

/* ---------- Form karti ---------- */
.right-panel {
    width: 500px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 40px 32px 0;
}

.nar-card {
    width: 100%;
    max-width: 440px;
    background: var(--nar-card);
    border-radius: 24px;
    padding: 40px 40px 28px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 30px 80px -20px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.04);
}

.form-header { text-align: center; margin-bottom: 28px; }
.form-header .nar-logo { width: 190px; height: auto; display: inline-block; margin-bottom: 22px; }
.form-header h2 { font-size: 1.6rem; font-weight: 700; color: var(--nar-ink); margin-bottom: 4px; }
.form-header p { color: var(--nar-muted); font-size: 0.95rem; }

/* ---------- Alanlar ---------- */
.form-floating { margin-bottom: 16px; }

.form-floating > .form-control {
    height: 58px;
    padding: 1rem 1rem 1rem 3.3rem;
    border: 1.5px solid var(--nar-line);
    border-radius: 14px;
    font-size: 1rem;
    background-color: var(--nar-field);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.form-floating > .form-control:focus {
    border-color: var(--nar-red);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.1);
}

.form-floating > label { padding: 1rem 1rem 1rem 3.3rem; color: var(--nar-muted); }

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.85) translateY(-0.75rem) translateX(0.15rem);
    color: var(--nar-red);
}

.input-icon { position: relative; }
.input-icon i {
    position: absolute;
    left: 20px;
    top: 29px;
    transform: translateY(-50%);
    color: #a4949a;
    z-index: 5;
    transition: color .2s ease;
    font-size: 1rem;
}
.input-icon:focus-within i { color: var(--nar-red); }

/* ---------- Butonlar ---------- */
.btn-login {
    width: 100%;
    height: 56px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--nar-red) 0%, #ff3b47 100%);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    box-shadow: 0 8px 20px -6px rgba(227, 6, 19, 0.55);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -6px rgba(227, 6, 19, 0.6); filter: brightness(1.04); }
.btn-login:active { transform: translateY(0); }
.btn-login:focus-visible { outline: 3px solid rgba(227, 6, 19, 0.35); outline-offset: 3px; }
.btn-login:disabled { opacity: .75; cursor: progress; transform: none; }

/* ---------- Uyarilar ---------- */
.alert-custom {
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
    display: none;
    font-weight: 500;
    font-size: 0.92rem;
}
.alert-custom.show { display: flex; align-items: center; animation: shakeX .5s ease-in-out; }
.alert-danger-custom { background: #fff4f0; color: #b4330f; border-left: 4px solid var(--nar-amber); }

/* ---------- Paneller ---------- */
.sms-panel { display: none; }
.sms-panel.active { display: block; animation: slideInRight .45s ease-out; }
.login-panel { animation: slideInLeft .45s ease-out; }
.login-panel.hide { display: none; }

.sms-code-inputs { display: flex; gap: 8px; justify-content: center; margin: 24px 0; }
.sms-code-input {
    width: 48px; height: 60px; text-align: center; font-size: 1.6rem; font-weight: 700;
    border: 1.5px solid var(--nar-line); border-radius: 12px; background: var(--nar-field);
    transition: border-color .2s ease, background .2s ease;
}
.sms-code-input:focus { border-color: var(--nar-red); background: #fff; outline: none; box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.1); }
.sms-info { text-align: center; margin-bottom: 16px; }
.sms-info i { font-size: 2.6rem; color: var(--nar-red); margin-bottom: 14px; }
.sms-info h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 6px; }
.sms-info p { color: var(--nar-muted); font-size: 0.92rem; }
.phone-number { font-weight: 700; color: var(--nar-red) !important; margin-top: 6px; }
.timer { text-align: center; margin: 16px 0; color: var(--nar-muted); font-size: 0.9rem; }
.timer span { font-weight: 700; color: var(--nar-red); }
.resend-link { text-align: center; margin-top: 16px; }
.resend-link a { color: var(--nar-red); font-weight: 600; text-decoration: none; cursor: pointer; }
.resend-link a.disabled { color: var(--nar-muted); pointer-events: none; }
.back-to-login { text-align: center; margin-top: 24px; }
.back-to-login a { color: var(--nar-muted); text-decoration: none; font-size: 0.9rem; cursor: pointer; }
.back-to-login a:hover { color: var(--nar-red); }

.login-footer { margin-top: 32px; text-align: center; color: var(--nar-muted); font-size: 0.82rem; }
.login-footer a { color: var(--nar-red); text-decoration: none; font-weight: 600; }

.nar-credit {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--nar-line);
    text-align: center;
    font-size: 0.78rem;
    color: var(--nar-muted);
}
.nar-credit a { color: var(--nar-ink); font-weight: 600; text-decoration: none; }
.nar-credit a:hover, .nar-credit a:focus-visible { color: var(--nar-red); text-decoration: underline; }

.success-checkmark { display: none; text-align: center; padding: 32px 0; }
.success-checkmark.show { display: block; animation: fadeInUp .5s ease-out; }
.success-checkmark i { font-size: 4rem; color: var(--nar-red); margin-bottom: 12px; }
.success-checkmark h3 { font-size: 1.4rem; font-weight: 700; }
.success-checkmark p { color: var(--nar-muted); }

/* ---------- Animasyonlar ---------- */
@keyframes narRise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}
@keyframes slideInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideInLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Dar ekran: sahne ustte, kart altta ---------- */
@media (max-width: 991.98px) {
    body {
        background:
            radial-gradient(ellipse 90% 40% at 50% 22%, rgba(160, 8, 24, 0.4) 0%, transparent 70%),
            var(--nar-night);
    }
    .login-container { flex-direction: column; }
    .nar-hero {
        flex: none;
        min-height: 44vh;
        min-height: 44dvh;
        padding: 24px 20px 16px;
        justify-content: flex-end;
        align-items: center;
        text-align: center;
    }
    .nar-hero h1, .nar-hero__lead, .nar-legend { display: none; }
    .nar-hero__eyebrow { margin: 0; }
    .right-panel { width: 100%; padding: 0 16px 24px; align-items: flex-start; }
    .nar-card { padding: 30px 22px 22px; border-radius: 20px; }
    .form-header .nar-logo { width: 160px; margin-bottom: 16px; }
}

@media (max-width: 380px) {
    .sms-code-inputs { gap: 6px; }
    .sms-code-input { width: 40px; height: 54px; font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
    .nar-hero, .nar-card { animation: none; opacity: 1; }
    #narScene { transition: none; }
    .alert-custom.show { animation: none; }
}
