/* =====================================================================
   Giriş / kayıt ekranları — "Marka alanı" yönü
   Solda Penta kırmızısı marka paneli, sağda beyaz form sütunu.
   Sadece .auth kapsamı altında çalışır; diğer sayfaların stillerine dokunmaz.
   ===================================================================== */

:root {
    --auth-red: #ab1a2d;
    --auth-red-dark: #8c1424;
    --auth-red-deep: #6f0f1c;
    --auth-red-ring: rgba(171, 26, 45, 0.15);
    --auth-ink: #17171a;
    --auth-ink-muted: #5f5e5a;
    --auth-line: #d9d7d1;
    --auth-line-soft: #e6e4df;
    --auth-placeholder: #9b9a95;
    --auth-error-bg: #fdebec;
    --auth-error-ink: #9f2f2d;
    --auth-success-bg: #edf3ec;
    --auth-success-ink: #346538;
    --auth-font: 'Geist', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --auth-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Layout'taki global body boşluğu ve gri zemin bu ekranda istenmiyor */
body:has(.auth) {
    margin-bottom: 0;
    background-color: #ffffff !important;
}

.auth {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    background: #ffffff;
    color: var(--auth-ink);
    font-family: var(--auth-font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.auth [hidden] {
    display: none !important;
}

/* ---------- Sol: kırmızı marka paneli ---------- */

.auth-brand {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    height: 100vh;
    height: 100dvh;
    padding: 56px clamp(40px, 5vw, 80px);
    overflow: hidden;
    background: var(--auth-red);
    color: #ffffff;
}

/* İki iç içe daire: panele derinlik verir */
.auth-brand::before,
.auth-brand::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand::after {
    right: -14vw;
    bottom: -18vw;
    width: 48vw;
    height: 48vw;
    max-width: 680px;
    max-height: 680px;
    background: var(--auth-red-dark);
}

.auth-brand::before {
    right: -4vw;
    bottom: -8vw;
    width: 28vw;
    height: 28vw;
    max-width: 400px;
    max-height: 400px;
    background: var(--auth-red-deep);
    z-index: 1;
}

.auth-brand > * {
    position: relative;
    z-index: 2;
}

.auth-kicker {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.auth-title {
    margin: 0;
    max-width: 14ch;
    text-wrap: balance;
    font-size: clamp(44px, 5vw, 76px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.035em;
    color: #ffffff;
}

.auth-lede {
    margin: 24px 0 0;
    max-width: 40ch;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.86);
}

.auth-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-steps li {
    padding: 14px 12px 0 0;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 14px;
    color: rgba(255, 255, 255, 0.78);
    transition: border-color 300ms ease;
}

.auth-steps li b {
    display: block;
    margin-bottom: 2px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.auth-steps li.is-on {
    border-top-color: #ffffff;
}

/* ---------- Sağ: form sütunu ---------- */

.auth-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px clamp(32px, 6vw, 112px);
}

.auth-form {
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    display: block;
    width: 120px;
    height: 32px;
    margin-bottom: 40px;
    background: url('../images/header.png') no-repeat -16px -21px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
    border-bottom: 2px solid var(--auth-line-soft);
}

.auth-tabs a {
    display: block;
    margin-bottom: -2px;
    padding: 12px 0;
    border-bottom: 3px solid transparent;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--auth-ink-muted);
    text-decoration: none;
    transition: color 160ms ease, border-color 160ms ease;
}

.auth-tabs a:hover {
    color: var(--auth-ink);
}

.auth-tabs a[aria-current="page"] {
    border-bottom-color: var(--auth-red);
    color: var(--auth-red);
    font-weight: 600;
}

.auth-heading {
    margin: 0 0 6px;
    font-family: var(--auth-font);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--auth-ink);
}

.auth-hint {
    margin: 0 0 28px;
    font-size: 15px;
    color: var(--auth-ink-muted);
}

.auth-label {
    display: block;
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-ink);
}

.auth-input {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 16px;
    border: 1px solid var(--auth-line);
    border-radius: 6px;
    background: #ffffff;
    font: inherit;
    font-size: 16px;
    color: var(--auth-ink);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-input::placeholder {
    color: var(--auth-placeholder);
}

.auth-input:hover {
    border-color: #b9b6ae;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-red);
    box-shadow: 0 0 0 3px var(--auth-red-ring);
}

.auth-input[readonly] {
    background: #f6f5f2;
    color: var(--auth-ink-muted);
}

.auth-input[aria-invalid="true"] {
    border-color: var(--auth-error-ink);
}

.auth-input.is-code {
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.4em;
    padding-left: calc(16px + 0.4em);
}

.auth-input.is-code::placeholder {
    letter-spacing: normal;
}

/* Bilgi / hata kutusu (giriş sayfası) */
.auth-message {
    display: none;
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
}

.auth-message.is-visible {
    display: block;
}

.auth-message.is-error {
    background: var(--auth-error-bg);
    color: var(--auth-error-ink);
}

.auth-message.is-success {
    background: var(--auth-success-bg);
    color: var(--auth-success-ink);
}

/* teknikProje.css'teki global #responseLabel kuralını (display:none, kırmızı) bu ekranlarda ez */
.auth #responseLabel.auth-message {
    display: none;
    margin: 16px 0 0;
    font-size: 14px;
}

.auth #responseLabel.auth-message.is-visible {
    display: block;
}

.auth #responseLabel.auth-message.is-error {
    color: var(--auth-error-ink);
}

.auth #responseLabel.auth-message.is-success {
    color: var(--auth-success-ink);
}

/* Ana buton */
.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 54px;
    margin-top: 20px;
    border: 0;
    border-radius: 6px;
    background: var(--auth-red);
    color: #ffffff;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms ease, transform 120ms ease;
}

.auth-submit:hover {
    background: var(--auth-red-dark);
}

.auth-submit:active {
    transform: scale(0.98);
}

.auth-submit:focus-visible,
.auth-btn:focus-visible,
.auth-link-btn:focus-visible,
.auth-tabs a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--auth-red);
}

.auth-submit:disabled {
    cursor: not-allowed;
    background: #c9a3a8;
}

.auth-submit[aria-busy="true"] {
    cursor: progress;
    background: var(--auth-red-dark);
}

.auth-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin 700ms linear infinite;
}

.auth-submit[aria-busy="true"] .auth-spinner {
    display: inline-block;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-legal {
    margin: 24px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--auth-ink-muted);
}

.auth-legal a,
.auth-check a {
    color: var(--auth-ink);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--auth-line);
    text-underline-offset: 3px;
    transition: text-decoration-color 160ms ease;
}

.auth-legal a:hover,
.auth-check a:hover {
    text-decoration-color: currentColor;
}

/* reCAPTCHA v3 rozeti gizlenir; yerine _RecaptchaNotice bilgilendirmesi gösterilir.
   display:none rozetin çalışmasını bozabildiği için visibility kullanılır. */
.grecaptcha-badge {
    visibility: hidden !important;
}

.auth-recaptcha {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.auth-recaptcha a {
    font-weight: 500;
}

/* ---------- Kayıt formu parçaları ---------- */

.auth-group {
    margin-bottom: 22px;
}

.auth-group-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.auth-group-head .auth-label {
    margin: 0 auto 0 0;
    font-size: 15px;
    font-weight: 600;
}

.auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

/* Doğrulanınca "Kod gönder" gizlenir; alan tüm genişliği alsın */
.auth-inline:has(> [hidden]) {
    grid-template-columns: 1fr;
}

.auth-btn {
    height: 52px;
    padding: 0 18px;
    border: 1.5px solid var(--auth-red);
    border-radius: 6px;
    background: transparent;
    color: var(--auth-red);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.auth-btn:hover {
    background: var(--auth-red);
    color: #ffffff;
}

.auth-btn.is-solid {
    background: var(--auth-red);
    color: #ffffff;
}

.auth-btn.is-solid:hover {
    background: var(--auth-red-dark);
    border-color: var(--auth-red-dark);
}

.auth-btn:disabled,
.auth-btn:disabled:hover {
    border-color: var(--auth-line);
    background: transparent;
    color: var(--auth-placeholder);
    cursor: not-allowed;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--auth-success-bg);
    color: var(--auth-success-ink);
    font-size: 12px;
    font-weight: 600;
}

.auth-badge::before {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg) translateY(-1px);
}

.auth-link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--auth-red);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.auth-link-btn:disabled {
    color: var(--auth-placeholder);
    text-decoration: none;
    cursor: not-allowed;
}

.auth-otp {
    margin-top: 10px;
}

.auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: var(--auth-ink-muted);
    font-variant-numeric: tabular-nums;
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--auth-ink-muted);
    cursor: pointer;
}

.auth-check input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--auth-red);
    cursor: pointer;
}

/* ---------- Doğrulama kodu ekranı ---------- */

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: -12px 0 28px;
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-ink-muted);
    text-decoration: none;
}

.auth-back::before {
    content: '';
    width: 8px;
    height: 8px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.auth-back:hover {
    color: var(--auth-red);
}

.auth-hint strong {
    color: var(--auth-ink);
    font-weight: 600;
    white-space: nowrap;
}

.auth-countdown {
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--auth-ink);
}

.auth-countdown.is-expired {
    color: var(--auth-error-ink);
}

.auth-code {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.auth-code-box {
    width: 100%;
    height: 64px;
    padding: 0;
    border: 1px solid var(--auth-line);
    border-radius: 6px;
    background: #ffffff;
    text-align: center;
    font: inherit;
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--auth-ink);
    caret-color: var(--auth-red);
    -webkit-tap-highlight-color: transparent;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-code-box::selection {
    background: transparent;
}

.auth-code-box:hover {
    border-color: #b9b6ae;
}

.auth-code-box:focus {
    outline: none;
    border-color: var(--auth-red);
    box-shadow: 0 0 0 3px var(--auth-red-ring);
}

.auth-code-box:disabled {
    background: #f6f5f2;
    cursor: not-allowed;
}

.auth-code + .auth-meta {
    margin-top: 12px;
}

/* Kayıt JS'inin yazdığı durum satırları */
.signup-status {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

.signup-status:empty {
    display: none;
}

.signup-status.error {
    color: var(--auth-error-ink);
}

.signup-status.success {
    color: var(--auth-success-ink);
}

.signup-status.is-banner {
    margin: 0 0 24px;
    padding: 12px 14px;
    border-radius: 6px;
    background: var(--auth-success-bg);
    font-size: 14px;
}

#completeStatus.error {
    padding: 12px 14px;
    border-radius: 6px;
    background: var(--auth-error-bg);
    font-size: 14px;
}

/* Bölüm aralığı; resume modunda JS ilkini gizler */
.signup-divider {
    height: 0;
    margin: 0;
    border: 0;
}

/* Kayıt sırasında formu kilitleyen katman */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
}

.auth-overlay .auth-spinner {
    display: block;
    width: 32px;
    height: 32px;
    border-width: 3px;
    border-color: var(--auth-red-ring);
    border-top-color: var(--auth-red);
}

/* ---------- Hata sayfası (Views/Shared/Error.cshtml) ---------- */

.auth-error-code {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 0 4px;
    padding: 12px 14px;
    border-radius: 6px;
    background: #f6f5f2;
    font-size: 13px;
    color: var(--auth-ink-muted);
}

.auth-error-code code {
    font-family: var(--auth-font);
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-ink);
    word-break: break-all;
}

.auth-error-actions {
    display: flex;
    gap: 10px;
}

.auth-error-actions .auth-submit {
    text-decoration: none;
}

a.auth-submit:hover {
    color: #ffffff;
}

.auth-submit--ghost,
.auth-submit--ghost:hover {
    border: 1.5px solid var(--auth-line);
    background: #ffffff;
    color: var(--auth-ink);
}

/* ---------- Giriş hareketi ---------- */

@media (prefers-reduced-motion: no-preference) {
    .auth-reveal {
        opacity: 0;
        transform: translateY(12px);
        animation: auth-reveal 600ms var(--auth-ease) forwards;
        animation-delay: calc(var(--i, 0) * 80ms);
    }

    @keyframes auth-reveal {
        to { opacity: 1; transform: none; }
    }
}

/* ---------- Kısa ekranlar ---------- */

@media (max-height: 760px) and (min-width: 961px) {
    .auth-brand { padding-top: 40px; padding-bottom: 40px; }
    .auth-title { font-size: clamp(40px, 4.2vw, 60px); }
    .auth-logo { margin-bottom: 28px; }
}

/* ---------- Tablet ve telefon ---------- */

@media (max-width: 960px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        position: relative;
        height: auto;
        gap: 20px;
        padding: 28px 20px 32px;
    }

    .auth-brand::after {
        right: -120px;
        bottom: -160px;
        width: 320px;
        height: 320px;
    }

    .auth-brand::before {
        right: -50px;
        bottom: -90px;
        width: 180px;
        height: 180px;
    }

    .auth-title {
        max-width: 14ch;
        font-size: clamp(32px, 8.5vw, 48px);
    }

    .auth-lede {
        margin-top: 12px;
        font-size: 16px;
    }

    .auth-steps {
        display: none;
    }

    .auth-main {
        justify-content: flex-start;
        padding: 28px 20px 48px;
    }

    .auth-form {
        max-width: none;
    }

    .auth-logo {
        margin-bottom: 24px;
    }

    .auth-tabs {
        margin-bottom: 24px;
    }
}

/* ---------- Telefon: formun tek ekrana sığması ---------- */

@media (max-width: 600px) {
    .auth-brand {
        padding: 24px 20px;
    }

    .auth-main {
        padding: 20px 20px 16px;
    }

    .auth-group {
        margin-bottom: 16px;
    }

    .auth-legal {
        margin-top: 16px;
    }

    .auth-logo {
        margin-bottom: 16px;
    }

    .auth-tabs {
        margin-bottom: 20px;
    }

    /* Üye ol açıklaması formdaki adımları tekrarlar; telefonda
       "Üyeliği tamamla" butonunu ekranın altına itiyordu. */
    .auth--signup .auth-lede {
        display: none;
    }

    .auth-recaptcha {
        margin-top: 6px;
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .auth-row {
        grid-template-columns: 1fr;
    }

    .auth-code {
        gap: 6px;
    }

    .auth-code-box {
        height: 54px;
        font-size: 22px;
    }

    .auth-btn {
        padding: 0 14px;
    }
}
