/* =========================================================
   AK LOGIN — modern split-screen tasarim
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --ak-primary: #2563eb;
    --ak-primary-dark: #1d4ed8;
    --ak-cyan: #38bdf8;
    --ak-indigo: #6366f1;
    --ak-text: #0f172a;
    --ak-text-soft: #334155;
    --ak-text-muted: #64748b;
    --ak-text-faint: #94a3b8;
    --ak-bg: #f8fafc;
    --ak-border: #e2e8f0;
    --ak-card: #ffffff;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ak-text);
    background: var(--ak-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: -.005em;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* ---------- Genel ızgara: 2 sütun (sol hero + sağ form) ---------- */
.ak-login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* =========================================================
   SOL PANEL — HERO / BRANDING
   ========================================================= */
/* Logo + basligin sagdaki form karti ile ayni hizada (dikeyde ortali) durmasi icin
   center kullanilir. Alt bilgi (.ak-login-hero-bottom) akistan cikarilip alta sabitlenir;
   orb'lar zaten absolute oldugundan akista yalnizca orta blok kalir. */
.ak-login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 56px;
    color: #fff;
    background: #0f172a;
    background-image:
        radial-gradient(circle at 16% 14%, rgba(56, 189, 248, .10) 0%, transparent 52%),
        radial-gradient(circle at 84% 86%, rgba(99, 102, 241, .07) 0%, transparent 52%),
        linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    overflow: hidden;
    isolation: isolate;
}

/* Yumuşak grid deseni overlay */
.ak-login-hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    z-index: -1;
}

/* Yüzen ışık küreleri — panel sidebar ile uyumlu, cok hafif */
.ak-login-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .28;
    pointer-events: none;
    z-index: -1;
}
.ak-login-orb.o1 {
    width: 360px; height: 360px;
    top: -90px; left: -90px;
    background: linear-gradient(135deg, rgba(56, 189, 248, .55), rgba(51, 65, 85, .4));
    animation: ak-orb 18s ease-in-out infinite;
}
.ak-login-orb.o2 {
    width: 320px; height: 320px;
    bottom: -100px; right: -80px;
    background: linear-gradient(135deg, rgba(99, 102, 241, .45), rgba(30, 41, 59, .5));
    animation: ak-orb 22s ease-in-out -10s infinite;
}
@keyframes ak-orb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(20px, -28px) scale(1.06); }
    66%      { transform: translate(-18px, 22px) scale(.98); }
}

/* Logo */
.ak-login-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 30px;
}
.ak-login-logo-mark {
    width: 50px; height: 50px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--ak-cyan), var(--ak-indigo));
    box-shadow: 0 10px 28px rgba(56, 189, 248, .4),
                inset 0 1px 0 rgba(255,255,255,.2);
}
.ak-login-logo-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.ak-login-logo-text > .name { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.ak-login-logo-text > .name b { color: var(--ak-cyan); font-weight: 700; }
.ak-login-logo-text > .sub  { font-size: 12.5px; color: rgba(255,255,255,.55); letter-spacing: .01em; }

/* Hero başlık + açıklama */
.ak-login-headline { margin: 0 0 36px 0; }
/* Basliktan sonra baska blok yoksa (ozellikler listesi kaldirildi) alttaki bosluk
   ortalamayi yukari kaydirmasin. */
.ak-login-headline:last-child { margin-bottom: 0; }
.ak-login-headline > h1 {
    font-size: 44px;
    font-weight: 700;
    letter-spacing: -.028em;
    margin: 0 0 16px 0;
    background: linear-gradient(135deg, #ffffff 25%, rgba(255,255,255,.65) 100%);
    -webkit-background-clip: text;
            background-clip: text;
}
.ak-login-headline > p {
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255,255,255,.78);
    margin: 0;
}

/* Özellikler */
.ak-login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
    max-width: 480px;
}
.ak-login-features > li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    color: rgba(255,255,255,.88);
    transition: transform .2s ease;
}
.ak-login-features > li:hover { transform: translateX(4px); }
.ak-login-features .check {
    flex: 0 0 28px;
    width: 28px; height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--ak-cyan);
    background: rgba(56, 189, 248, .15);
    border: 1px solid rgba(56, 189, 248, .25);
}

/* Hero alt bilgi */
.ak-login-hero-bottom {
    /* Akistan cikar: orta blok hero'nun TAM yuksekliginde ortalanabilsin.
       left/right/bottom degerleri .ak-login-hero padding'i (48px 56px) ile ayni. */
    position: absolute;
    left: 56px;
    right: 56px;
    bottom: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255,255,255,.5);
    font-size: 13px;
}
.ak-login-hero-bottom a { color: rgba(255,255,255,.7); }
.ak-login-hero-bottom a:hover { color: #fff; }

/* =========================================================
   SAĞ PANEL — FORM
   ========================================================= */
.ak-login-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: var(--ak-bg);
    background-image:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .05) 0%, transparent 35%),
        radial-gradient(circle at 0% 100%, rgba(56, 189, 248, .05) 0%, transparent 35%);
    position: relative;
}

/* Mobilde gözükecek küçük logo (desktop'ta gizli) */
.ak-login-mobile-logo {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    color: var(--ak-text);
}
.ak-login-mobile-logo .mark {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--ak-cyan), var(--ak-indigo));
    box-shadow: 0 8px 20px rgba(56, 189, 248, .35);
}
.ak-login-mobile-logo .name { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.ak-login-mobile-logo .name b { color: var(--ak-primary); font-weight: 700; }

.ak-login-card {
    width: 100%;
    max-width: 420px;
    animation: ak-card-in .55s cubic-bezier(.16, 1, .3, 1);
}
@keyframes ak-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ak-login-card-header { margin-bottom: 30px; }
.ak-login-card-header > h2 {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.025em;
    color: var(--ak-text);
    margin: 0 0 8px 0;
}
.ak-login-card-header > p {
    color: var(--ak-text-muted);
    margin: 0;
    font-size: 15px;
}

/* Bildirim alanı */
.ak-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    animation: ak-shake .35s cubic-bezier(.36, .07, .19, .97);
}
.ak-alert[hidden] { display: none !important; }
.ak-alert.error   { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.ak-alert.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.ak-alert.info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.ak-alert > .fa { font-size: 16px; flex-shrink: 0; }
@keyframes ak-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Form */
.ak-login-form { display: grid; gap: 18px; }

/* Cloudflare Turnstile — form alanlarıyla aynı genişlikte.
   Widget data-size="flexible" ile render edilir; Cloudflare'ın alt sınırı 300px
   olduğu için çok dar ekranlarda taşmaması adına iframe de %100'e sabitlenir. */
.ak-login-form .cf-turnstile { width: 100%; }
.ak-login-form .cf-turnstile iframe { width: 100% !important; max-width: 100%; }

.ak-field { display: flex; flex-direction: column; gap: 7px; }
.ak-field-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ak-text-soft);
    margin: 0;
}
.ak-field-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--ak-primary);
}
.ak-field-link:hover { color: var(--ak-primary-dark); text-decoration: underline; }

.ak-field-input {
    position: relative;
    display: flex;
    align-items: center;
}
.ak-field-input > .icon {
    position: absolute;
    left: 14px;
    color: var(--ak-text-faint);
    font-size: 15px;
    pointer-events: none;
    transition: color .2s ease;
}
.ak-field-input > input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 42px;
    background: #fff;
    border: 1px solid var(--ak-border);
    border-radius: 11px;
    color: var(--ak-text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    -webkit-appearance: none;
    appearance: none;
}
.ak-field-input > input::placeholder { color: var(--ak-text-faint); }
.ak-field-input > input:hover { border-color: #cbd5e1; }
.ak-field-input > input:focus {
    outline: none;
    border-color: var(--ak-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
    background: #fff;
}
.ak-field-input:focus-within > .icon { color: var(--ak-primary); }

.ak-field-input.has-toggle > input { padding-right: 46px; }
.ak-field-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px; height: 38px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: var(--ak-text-faint);
    cursor: pointer;
    transition: all .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.ak-field-toggle:hover { color: var(--ak-primary); background: var(--ak-bg); }
.ak-field-toggle:focus { outline: none; }

.ak-field-input.is-invalid > input {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, .1);
}

/* Checkbox + remember */
.ak-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.ak-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.ak-checkbox input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--ak-primary);
    margin: 0;
    cursor: pointer;
}
.ak-checkbox > span {
    font-size: 14px;
    color: var(--ak-text-soft);
}

/* Submit butonu */
.ak-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    width: 100%;
    padding: 0 22px;
    margin-top: 4px;
    background: linear-gradient(135deg, var(--ak-primary) 0%, var(--ak-primary-dark) 100%);
    border: 0;
    border-radius: 11px;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -.005em;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: transform .15s ease, box-shadow .25s ease, opacity .2s ease;
    box-shadow: 0 6px 18px rgba(37, 99, 235, .35),
                inset 0 1px 0 rgba(255,255,255,.15);
    -webkit-tap-highlight-color: transparent;
}
.ak-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .6s ease;
}
.ak-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .42),
                inset 0 1px 0 rgba(255,255,255,.18);
}
.ak-submit:hover:not(:disabled)::before { transform: translateX(100%); }
.ak-submit:hover:not(:disabled) > .fa { transform: translateX(3px); }
.ak-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.ak-submit:focus-visible {
    outline: 2px solid var(--ak-primary);
    outline-offset: 2px;
}
.ak-submit > .fa { transition: transform .2s ease; }
.ak-submit:disabled { cursor: not-allowed; opacity: .85; }

/* Loading spinner */
.ak-submit.is-loading > .text,
.ak-submit.is-loading > .fa { opacity: 0; visibility: hidden; }
.ak-submit.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 22px; height: 22px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ak-spin .7s linear infinite;
}
@keyframes ak-spin { to { transform: rotate(360deg); } }

/* Card altı yardım metni */
.ak-card-footer {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--ak-border);
    text-align: center;
    color: var(--ak-text-muted);
    font-size: 13.5px;
}
.ak-card-footer a { color: var(--ak-primary); font-weight: 500; }
.ak-card-footer a:hover { color: var(--ak-primary-dark); text-decoration: underline; }
.ak-login-logo-text img {width:190px}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 991px) {
    .ak-login-shell { grid-template-columns: 1fr; }
    .ak-login-hero { display: none; }
    .ak-login-mobile-logo { display: inline-flex; }

    .ak-login-main {
        min-height: 100vh;
        padding: 32px 24px;
        background:
            radial-gradient(circle at 18% 18%, rgba(56, 189, 248, .12) 0%, transparent 45%),
            radial-gradient(circle at 82% 82%, rgba(99, 102, 241, .12) 0%, transparent 45%),
            linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    }
    .ak-login-card {
        background: #fff;
        padding: 32px 28px;
        border-radius: 18px;
        box-shadow: 0 20px 50px rgba(15, 23, 42, .12),
                    0 4px 12px rgba(15, 23, 42, .04);
        border: 1px solid rgba(255,255,255,.6);
    }
}

@media (max-width: 480px) {
    .ak-login-main { padding: 24px 16px; }
    .ak-login-card { padding: 26px 22px; border-radius: 16px; }
    .ak-login-card-header > h2 { font-size: 23px; }
    .ak-login-card-header > p  { font-size: 14px; }
    .ak-field-input > input { height: 48px; }
    .ak-submit { height: 50px; font-size: 15.5px; }
}

/* ============================================================
   Kart altindaki yardimci baglanti + basari uyarisi
   ------------------------------------------------------------
   giris.php ve magic_link.php'den TASINDI (proje kurali: gorunumde
   satir ici <style> yok). Iki gorunumde AYNI blok iki kez yaziliydi;
   burada tek kopya duruyor.
   Kurallar .ak-login-card ile kapsanir: global cakisma olmasin.
   ============================================================ */
.ak-login-card .ak-alt-link {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}
.ak-login-card .ak-alt-link a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}
.ak-login-card .ak-alt-link a:hover { text-decoration: underline; }
.ak-login-card .ak-alt-not {
    display: block;
    color: #64748b;
    margin-bottom: 4px;
}

/* Basarili islem uyarisi (ör. "giris linki gonderildi") */
.ak-alert.ak-alert-basarili {
    background: #dcfce7;
    color: #166534;
}

/* ============================================================
   MOBILDE ODAKLANINCA KENDILIGINDEN BUYUTME (auto-zoom) KAPALI
   ============================================================
   Giris alanlari 15px; iOS 16px'in altindaki bir alana odaklaninca sayfayi
   kendiliginden buyutuyordu. Sayfanin viewport etiketinde user-scalable=no
   yaziyor ama iOS 10'dan beri onu yok sayiyor — calisan tek cozum 16px. */
@media (max-width: 767px) {
    .ak-field-input > input,
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ============================================================
   CIHAZLA GIRIS (passkey) — formun USTUNDEKI dugme
   ============================================================
   Sifre alanindan once durur: amac "once bunu dene" demek. Ana gonder
   dugmesiyle ayni boyda ama dolgusuz — birincil eylem hala Giris Yap. */
.ak-passkey-kutu { margin-bottom: 18px; }

.ak-passkey-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    background: transparent;
    border: 1px solid var(--ak-primary);
    border-radius: 11px;
    color: var(--ak-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.ak-passkey-btn:hover { background: var(--ak-primary); color: #fff; }
.ak-passkey-btn:disabled { opacity: .6; cursor: default; }
.ak-passkey-btn.ak-bekliyor { opacity: .6; cursor: progress; }

.ak-passkey-mesaj {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--ak-danger, #ef4444);
}

/* ---------- E-posta | Telefon secimi (parca/giris_kimlik.php + giris.js) ---------- */
.ak-giris-sekme {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    background: var(--ak-bg);
    border: 1px solid var(--ak-border);
    border-radius: 12px;
}
.ak-giris-sekme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ak-text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.ak-giris-sekme-btn:hover { color: var(--ak-text); }
.ak-giris-sekme-btn.is-aktif {
    background: var(--ak-card);
    color: var(--ak-primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.ak-giris-sekme-btn:focus-visible { outline: 2px solid var(--ak-primary); outline-offset: 1px; }

/* .ak-field display:flex, tarayicinin [hidden] kuralini ezer */
.ak-login-form .ak-field[hidden],
.ak-login-form .ak-alert[hidden] { display: none; }

/* Telefon: ulke secici alanin solunda; simge yok, dolgu eklentiye birakilir */
.ak-field-telefon .iti { display: block; width: 100%; }
.ak-field-telefon .iti > input {
    width: 100%;
    height: 50px;
    background: #fff;
    border: 1px solid var(--ak-border);
    border-radius: 11px;
    color: var(--ak-text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color .2s ease, box-shadow .2s ease;
    -webkit-appearance: none;
    appearance: none;
}
.ak-field-telefon .iti > input:focus {
    outline: none;
    border-color: var(--ak-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.ak-field-telefon .js-telefon-uyari { margin-top: 6px; font-size: 12.5px; color: #dc2626; }
.ak-field-not { font-size: 12.5px; color: var(--ak-text-muted); }
