/* ==========================================================================
   GİRİŞ / KAYIT / DOĞRULAMA EKRANLARI
   Yarıçap ölçeği: kart 24, panel 20, alan ve düğme 16.
   Renkler yalnızca tema değişkenlerinden gelir; koyu temada kendiliğinden döner.
   ========================================================================== */

.auth-hub {
    min-height: 100vh;
    display: flex;
    /* "safe": kart ekrandan uzunsa ortalamak yerine üstten hizalanır; ortalama
       hâlinde kartın alt kenarı görünmez alana taşıyor ve çerez şeridinin
       altında kalıyordu. */
    align-items: center;
    align-items: safe center;
    justify-content: center;
    /* Alt boşluk çerez şeridinin yüksekliğini de kapsar; aksi hâlde şerit
       giriş düğmesini örtüyor ve kullanıcı şeridi kapatmadan giremiyordu. */
    padding: 120px 20px calc(48px + var(--cerez-bosluk, 0px));
    background: rgb(var(--sand-100));
}

.auth-card {
    background: rgb(var(--beyaz));
    width: 100%;
    max-width: 520px;
    padding: 44px 40px;
    border-radius: 24px;
    border: 1px solid rgb(var(--sand-200));
    box-shadow: 0 1px 2px rgb(var(--golge) / .04), 0 18px 48px -18px rgb(var(--golge) / .18);
}

@media (max-width: 480px) {
    .auth-hub { padding: 104px 16px calc(40px + var(--cerez-bosluk, 0px)); }
    .auth-card { padding: 28px 20px; border-radius: 20px; }
}

/* Marka ve karşılama */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: rgb(var(--ink-900));
    text-decoration: none;
    display: inline-block;
    margin-bottom: 20px;
    letter-spacing: -1.5px;
}
.auth-logo span { color: rgb(var(--brand-600)); }

.auth-header h1 {
    font-size: 1.5rem;
    color: rgb(var(--ink-900));
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-header p {
    font-size: 0.95rem;
    color: rgb(var(--ink-600));
    line-height: 1.55;
}
.auth-header p strong { color: rgb(var(--ink-900)); }

/* --------------------------------------------------------------------------
   Sayfa düzeyindeki iletiler
   -------------------------------------------------------------------------- */
.auth-message {
    padding: 14px 16px;
    border-radius: 16px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.55;
    border: 1px solid transparent;
}
.auth-message.error {
    background: rgb(var(--red-50));
    color: rgb(var(--red-800));
    border-color: rgb(var(--red-200));
}
.auth-message.success {
    background: rgb(var(--yesil-50));
    color: rgb(var(--yesil-800));
    border-color: rgb(var(--yesil-100));
}
.auth-message strong {
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}
.auth-message p { margin: 0; }
.auth-message ul { list-style: disc; margin: 0; padding-left: 20px; }
.auth-message li + li { margin-top: 4px; }

/* Geliştirme ortamı kutusu — canlıda görünmez */
.auth-not-gelistirme {
    margin-bottom: 24px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgb(var(--amber-50));
    border: 1px dashed rgb(var(--amber-500));
    color: rgb(var(--amber-800));
    font-size: 0.82rem;
    line-height: 1.6;
    text-align: left;
}
.auth-not-gelistirme strong { display: block; margin-bottom: 4px; }
.auth-not-gelistirme a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 8px;
    padding: 0 14px;
    border-radius: 16px;
    background: rgb(var(--amber-700));
    color: rgb(var(--beyaz));
    font-weight: 700;
    text-decoration: none;
}

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

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.input-group > label,
.rol-secim legend {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgb(var(--ink-700));
}

.etiket-istege-bagli {
    margin-left: 6px;
    font-weight: 500;
    font-size: 0.78rem;
    color: rgb(var(--ink-500));
}

.forgot-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
    font-size: 0.82rem;
    color: rgb(var(--brand-700));
    text-decoration: none;
    font-weight: 600;
}
.forgot-link:hover { text-decoration: underline; }
.forgot-link:focus-visible { outline: 2px solid rgb(var(--brand-600)); outline-offset: 2px; border-radius: 16px; }

/* Alan kutusu */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Yalnızca soldaki ana ikon; sağdaki göz düğmesi etkilenmez */
.input-wrapper > svg {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: rgb(var(--ink-400));
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    min-height: 48px;
    background: rgb(var(--sand-100));
    border: 1px solid rgb(var(--sand-200));
    padding: 12px 52px 12px 44px;
    border-radius: 16px;
    font: inherit;
    font-size: 0.95rem;
    color: rgb(var(--ink-900));
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
/* Solunda ikon olmayan alanlar (soyad, şifre tekrarı) */
.input-wrapper.yalin input { padding-left: 16px; }
.input-wrapper input::placeholder { color: rgb(var(--ink-400)); }

.input-wrapper input:focus,
.input-wrapper select:focus {
    background: rgb(var(--beyaz));
    border-color: rgb(var(--brand-600));
    box-shadow: 0 0 0 3px rgb(var(--brand-500) / 0.22);
}
/* İkon alanın önünde durduğu için kardeş birleştiricisi işe yaramaz. */
.input-wrapper:has(input:focus) > svg,
.input-wrapper:has(input:not(:placeholder-shown)) > svg { color: rgb(var(--ink-600)); }

/* Hatalı alan */
.input-wrapper.has-error input,
.input-wrapper.has-error select {
    border-color: rgb(var(--red-500));
    background: rgb(var(--red-50));
}
.input-wrapper.has-error > svg { color: rgb(var(--red-700)); }
.input-wrapper.has-error input:focus,
.input-wrapper.has-error select:focus { box-shadow: 0 0 0 3px rgb(var(--red-500) / 0.22); }

/* Yan yana alanlar */
.input-row { display: flex; gap: 14px; }
.input-row .input-group { flex: 1; }
@media (max-width: 640px) {
    .input-row { flex-direction: column; gap: 22px; }
}

/* Açılır liste */
.select-wrapper select {
    padding-right: 44px;
    appearance: none;
    cursor: pointer;
}
.select-wrapper::after {
    content: "";
    position: absolute;
    right: 20px;
    top: 50%;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid rgb(var(--ink-400));
    border-bottom: 2px solid rgb(var(--ink-400));
    transform: rotate(45deg);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Üyelik tipi seçimi
   -------------------------------------------------------------------------- */
.rol-secim {
    border: 0;
    padding: 0;
    margin: 0;
}
.rol-secim legend { padding: 0; margin-bottom: 8px; }

.role-selector {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    background: rgb(var(--sand-100));
    padding: 6px;
    border-radius: 20px;
}
@media (min-width: 520px) {
    .role-selector { grid-template-columns: repeat(3, 1fr); }
}

.role-selector label { display: block; cursor: pointer; }
/* Ekrandan gizlenir ama klavyeyle odaklanabilir kalır; display:none kullanılırsa
   seçim tamamen klavyesiz kalırdı. */
.role-selector input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.role-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 2px solid transparent;
    background: transparent;
    color: rgb(var(--ink-600));
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.role-option svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: rgb(var(--ink-400));
}
.role-option__metin { display: flex; flex-direction: column; min-width: 0; }
.role-option__ad { font-size: 0.9rem; font-weight: 600; }
.role-option__alt { font-size: 0.75rem; color: rgb(var(--ink-500)); }

@media (min-width: 520px) {
    .role-option { flex-direction: column; text-align: center; gap: 4px; padding: 12px 8px; }
    .role-option__metin { align-items: center; }
}

.role-selector input:checked + .role-option {
    background: rgb(var(--beyaz));
    border-color: rgb(var(--brand-600));
    color: rgb(var(--ink-900));
}
.role-selector input:checked + .role-option svg { color: rgb(var(--brand-600)); }
.role-selector input:checked + .role-option .role-option__alt { color: rgb(var(--ink-500)); }
.role-selector input:focus-visible + .role-option {
    outline: 2px solid rgb(var(--brand-600));
    outline-offset: 2px;
}

/* Seçilen tipin ne gerektirdiğini ve ne kazandırdığını anlatan özet */
.rol-ozet {
    display: none;
    background: rgb(var(--sand-50));
    border: 1px solid rgb(var(--sand-200));
    border-radius: 20px;
    padding: 16px 18px;
}
.rol-ozet dl { margin: 0; display: grid; gap: 10px; }
.rol-ozet dt {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(var(--ink-500));
}
.rol-ozet dd {
    margin: 2px 0 0;
    font-size: 0.85rem;
    line-height: 1.55;
    color: rgb(var(--ink-700));
}

/* Koşullu alan blokları */
.form-fields-group {
    display: none;
    flex-direction: column;
    gap: 18px;
    background: rgb(var(--sand-50));
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgb(var(--sand-200));
}

/* Görünürlüğü seçili radyo belirler: JS kapalıyken de doğru alanlar açılır. */
#register-form:has(#rol-uye:checked) #rol-ozet-uye,
#register-form:has(#rol-serbest:checked) #rol-ozet-serbest,
#register-form:has(#rol-kurumsal:checked) #rol-ozet-kurumsal { display: block; }
#register-form:has(#rol-serbest:checked) #serbest-fields,
#register-form:has(#rol-kurumsal:checked) #kurumsal-fields { display: flex; }

/* :has() desteklenmiyorsa hiçbir alan gizlenmez — eksik alanla kayıt denenmesindense
   fazla alan görünmesi yeğdir; sunucu yine seçili tipe göre doğrular. */
@supports not selector(:has(*)) {
    .rol-ozet { display: block; }
    .form-fields-group { display: flex; }
}

/* --------------------------------------------------------------------------
   Yardım metinleri ve anlık geri bildirim
   -------------------------------------------------------------------------- */
.girdi-ipucu {
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgb(var(--ink-500));
    margin: 0;
}

.status-text {
    font-size: 0.8rem;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-weight: 500;
    line-height: 1.45;
}
.status-text:empty { display: none; }
.status-text.success { color: rgb(var(--yesil-800)); }
.status-text.error { color: rgb(var(--red-800)); }
.status-text.success::before { content: "✓"; font-weight: 700; }
.status-text.error::before { content: "!"; font-weight: 800; }

/* Bilgi kutuları */
.auth-alert {
    padding: 14px 16px;
    border-radius: 16px;
    font-size: 0.83rem;
    line-height: 1.55;
    margin: 0;
}
.auth-alert.info {
    background: rgb(var(--celik-50));
    color: rgb(var(--celik-700));
    border: 1px solid rgb(var(--celik-100));
}
.auth-alert strong { display: block; margin-bottom: 2px; font-weight: 700; }

/* Onay kutuları — dokunma hedefi etiketle birlikte 44px */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    padding: 4px 0;
}
.checkbox-group input[type="checkbox"] {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: rgb(var(--brand-600));
    cursor: pointer;
}
.checkbox-group input[type="checkbox"]:focus-visible {
    outline: 2px solid rgb(var(--brand-600));
    outline-offset: 2px;
}
.checkbox-group label {
    font-size: 0.85rem;
    color: rgb(var(--ink-600));
    line-height: 1.55;
    cursor: pointer;
}
.checkbox-group label a { color: rgb(var(--brand-700)); font-weight: 600; text-decoration: underline; }

/* Yasal not */
.auth-legal-note {
    font-size: 0.775rem;
    line-height: 1.6;
    color: rgb(var(--ink-500));
    margin: 0;
}
.auth-legal-note--son { text-align: center; }

/* Şifreyi göster/gizle */
.password-toggle {
    position: absolute;
    right: 4px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    border-radius: 16px;
    padding: 0;
    color: rgb(var(--ink-400));
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-toggle:hover { color: rgb(var(--ink-700)); }
.password-toggle:focus-visible { outline: 2px solid rgb(var(--brand-600)); outline-offset: -2px; }
.password-toggle svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   Düğmeler ve alt bağlantılar
   -------------------------------------------------------------------------- */
.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    border: none;
    border-radius: 16px;
    background: rgb(var(--ink-900));
    color: rgb(var(--beyaz));
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    text-decoration: none;
    text-align: center;
}
.btn-auth:focus-visible { outline: 2px solid rgb(var(--brand-600)); outline-offset: 2px; }
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }

/* İkincil eylem: yeni kod iste, adresi değiştir */
.btn-auth-ikincil {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 16px;
    border: 1px solid rgb(var(--sand-200));
    background: rgb(var(--beyaz));
    color: rgb(var(--ink-900));
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.btn-auth-ikincil:hover { border-color: rgb(var(--ink-300)); }
.btn-auth-ikincil:focus-visible { outline: 2px solid rgb(var(--brand-600)); outline-offset: 2px; }

.auth-ikincil-satir { margin-top: 16px; text-align: center; }
.auth-ikincil-satir p { font-size: 0.82rem; color: rgb(var(--ink-500)); margin: 0 0 8px; }

.auth-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 0.9rem;
    color: rgb(var(--ink-500));
}
.auth-footer a {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    padding: 0 6px;
    color: rgb(var(--ink-900));
    font-weight: 700;
    text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }
.auth-footer a:focus-visible { outline: 2px solid rgb(var(--brand-600)); outline-offset: 2px; border-radius: 16px; }

/* Doğrulama kodu alanı: tek alan, altı hane */
.otp-girdi {
    letter-spacing: 0.45em;
    text-indent: 0.45em;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
}

/* ==========================================================================
   İki bölmeli düzen (geniş ekran): solda marka paneli, sağda form
   ========================================================================== */
.auth-panel { display: none; }

@media (min-width: 1024px) {
    .auth-hub {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
        padding: 80px 0 0;
        min-height: 100vh;
    }
    .auth-hub > .auth-card { align-self: center; justify-self: center; margin: 48px 32px; }
    .auth-panel {
        display: block;
        position: sticky;
        top: 80px;
        height: calc(100vh - 80px);
        overflow: hidden;
        background: rgb(var(--ink-950));
        color: rgb(var(--beyaz));
    }
    .auth-panel::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(80% 60% at 0% 100%, rgb(var(--brand-500) / .32), transparent 60%),
                    linear-gradient(160deg, rgb(var(--ink-950) / .55), rgb(var(--ink-950) / .92));
    }
    .auth-panel__icerik {
        position: relative;
        z-index: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 32px;
        padding: 56px clamp(40px, 5vw, 80px);
    }
    .auth-panel__logo {
        font-family: 'Sora', 'Inter', sans-serif;
        font-size: 1.6rem;
        font-weight: 600;
        color: rgb(var(--beyaz));
        letter-spacing: -.02em;
    }
    .auth-panel__logo span { color: rgb(var(--brand-300)); }
    .auth-panel__baslik {
        font-family: 'Sora', 'Inter', sans-serif;
        font-size: clamp(1.8rem, 2.4vw, 2.4rem);
        line-height: 1.14;
        font-weight: 600;
        letter-spacing: -.02em;
        max-width: 18ch;
    }
    .auth-panel__liste { margin-top: 26px; list-style: none; display: grid; gap: 12px; max-width: 38ch; padding: 0; }
    .auth-panel__liste li {
        position: relative;
        padding: 14px 0 14px 22px;
        border-top: 1px solid rgb(255 255 255 / .10);
        font-size: .95rem;
        line-height: 1.55;
        color: rgb(var(--ink-100));
    }
    .auth-panel__liste li::before {
        content: "";
        position: absolute;
        left: 0;
        top: 24px;
        width: 10px;
        height: 2px;
        border-radius: 2px;
        background: rgb(var(--brand-300));
    }
    .auth-panel__alt { font-size: .8rem; color: rgb(var(--ink-300)); }
}
