/**
 * Slipvise giriş / kayıt / şifre ekranları
 *
 * Figma: "Login Ekranı Tasarımı", "Hesap Oluşturma Ekranı Tasarımı", "Yeni Kayıt Seçim Ekranı".
 * Renkler tokens.css içindeki değişkenlerden gelir.
 */

body.auth-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--sv-bg);
    font-family: var(--sv-font);
}

.auth-hint strong,
.auth-hint span {
    display: inline-block;
}

.auth-wrapper {
    width: 100%;
    padding: 16px;
    display: flex;
    justify-content: center;
}

.auth-card {
    width: 100%;
    max-width: 340px;
    background-color: var(--sv-surface);
    border-radius: 24px;
    box-shadow: var(--sv-card-shadow);
    padding: 28px 20px 26px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-card--register {
    max-width: 340px;
    padding: 26px 20px 24px;
    gap: 14px;
}

.auth-card--terms {
    max-width: 560px;
    padding: 28px 32px;
    gap: 24px;
    align-items: stretch;
    text-align: left;
}

.auth-card--select {
    max-width: 340px;
    padding: 26px 20px 24px;
    gap: 14px;
}

.auth-brand {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-card--select .auth-brand {
    margin-bottom: 0;
}

.auth-brand__link {
    color: var(--sv-text);
    text-decoration: none;
}

.auth-brand__logo {
    width: auto;
    height: 50px;
}

.auth-brand__tagline {
    margin: 0;
    color: var(--sv-text-subtle);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-brand__tagline .badge {
    background-color: var(--sv-surface-2);
    color: var(--sv-text);
    padding: 4px 8px;
    border-radius: var(--sv-radius-pill);
    font-size: 12px;
}

.auth-intro {
    text-align: center;
    color: var(--sv-text);
    font-size: 15px;
    margin: 0;
    font-weight: 600;
}

.auth-heading {
    margin: 0;
    text-align: center;
    color: var(--sv-text);
    font-size: 14px;
    font-weight: 700;
}

.auth-subtitle {
    margin: 0;
    text-align: center;
    color: var(--sv-text);
    font-size: 14px;
    font-weight: 400;
}

.auth-heading--select {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5em;
    margin-bottom: 2px;
}

.auth-subtitle--select {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5em;
    margin-bottom: 0;
}

.auth-card--terms .auth-heading {
    text-align: left;
    font-size: 18px;
}

.auth-card--terms .auth-subtitle {
    text-align: left;
    font-size: 14px;
    color: var(--sv-text-muted);
}

/* Etiket alanına yakın (6px), alan grupları birbirinden uzak (16px): etiketin hangi alana ait olduğu belli olur */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field__label {
    font-size: 13px;
    color: var(--sv-text);
    margin: 0;
}

/* Alanın altındaki kısa açıklama (ör. şifre kuralı) */
.auth-field__hint {
    font-size: 12px;
    line-height: 16px;
    color: var(--sv-text-muted);
}

.auth-field__wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-field__input {
    border-radius: var(--sv-radius-sm);
    border: 1px solid var(--sv-border);
    background-color: var(--sv-surface-2);
    padding: 9px 12px;
    font-size: 14px;
    color: var(--sv-text);
    width: 100%;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-field__input--with-icon {
    padding-right: 40px;
}

.auth-field__input:focus {
    outline: none;
    border-color: var(--sv-ink);
    box-shadow: var(--sv-focus-ring);
}

.auth-field__icon {
    position: absolute;
    right: 12px;
    display: flex;
    color: var(--sv-text-subtle);
    pointer-events: none;
}

.auth-field__icon .sv-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.75;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-button {
    width: 100%;
    border-radius: var(--sv-radius-sm);
    background-color: var(--sv-primary-bg);
    color: var(--sv-primary-fg);
    padding: 9px 10px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    transition: background-color 0.2s ease;
}

.auth-button:hover {
    background-color: var(--sv-primary-hover);
}

.auth-reminder {
    text-align: center;
    color: var(--sv-text);
    font-size: 14px;
    margin: 0;
}

/* Tek başına duran bağlantı ("Giriş sayfasına dön") ortalı kalır; önünde metin varsa 6px ayrılır */
.auth-reminder__link {
    margin-left: 6px;
    font-weight: 700;
    color: var(--sv-text);
    text-decoration: none;
}

.auth-reminder__link:first-child {
    margin-left: 0;
}

.auth-reminder__link:hover {
    color: var(--sv-text);
    text-decoration: underline;
}

.auth-demo {
    border-top: 1px solid var(--sv-border);
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-demo__title {
    text-align: center;
    color: var(--sv-text-subtle);
    font-size: 13px;
    margin: 0;
}

.auth-demo__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-demo__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--sv-radius-pill);
    padding: 8px 12px;
    font-size: 13px;
}

.auth-demo__button .sv-icon {
    width: 16px;
    height: 16px;
}

.auth-flash {
    margin-bottom: 0;
    border-radius: 12px;
}

.auth-terms {
    display: flex;
    justify-content: flex-start;
    margin: 4px 0;
}

.auth-terms .custom-control-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--sv-text);
}

.auth-terms__link {
    font-weight: 700;
    color: var(--sv-text);
    text-decoration: none;
}

.auth-terms__link:hover {
    color: var(--sv-text);
    text-decoration: underline;
}

.auth-terms-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--sv-text);
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

/* Veritabanındaki sayfa içeriği (ör. Kullanım Şartları): başlık kendi paragrafına yakın, önceki bölümden uzak */
.auth-terms-content > h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 32px;
    color: var(--sv-text);
}

.auth-terms-content > h2,
.auth-terms-content > h3 {
    margin: 12px 0 -8px;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: var(--sv-text);
}

.auth-terms-content > p,
.auth-terms-content > ul,
.auth-terms-content > ol {
    margin: 0;
    color: var(--sv-text-body);
}

.auth-terms-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-terms-section h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--sv-text);
}

.auth-terms-section p {
    margin: 0;
    color: var(--sv-text-muted);
}

.auth-hint {
    text-align: center;
    color: var(--sv-text-subtle);
    font-size: 13px;
    margin: -14px 0 6px;
}

.auth-forgot {
    font-size: 13px;
    color: var(--sv-text);
    text-decoration: none;
}

.auth-forgot:hover {
    color: var(--sv-text);
    text-decoration: underline;
}

/* Hesap türü seçimi */
.account-type-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.account-type-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background-color: var(--sv-surface);
    border: 2px solid var(--sv-border);
    border-radius: 16px;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.account-type-button:hover {
    border-color: var(--sv-ink);
    box-shadow: var(--sv-card-shadow);
    text-decoration: none;
}

.account-type-button__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: var(--sv-chip-bg);
    border-radius: 12px;
    flex-shrink: 0;
}

.account-type-button__icon .sv-icon {
    width: 22px;
    height: 22px;
    color: var(--sv-chip-fg);
}

.account-type-button__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.account-type-button__title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--sv-text);
    line-height: 1.5em;
    text-align: left;
}

.account-type-button__description {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    color: var(--sv-text);
    line-height: 1.5em;
    text-align: left;
}

/* --- Durum ekranları ------------------------------------------------------
   Hata sayfaları (404, 400, sunucu hatası), telefon doğrulama sonucu ve ödeme sonucu: logo, ikon kutusu,
   başlık, kısa açıklama ve düğmeler. Betikle durum değiştiren sayfalarda görünmeyen durum `hidden` taşır. */

.auth-card--status {
    max-width: 380px;
    padding: 32px 24px 28px;
    gap: 20px;
}

.auth-card--wide {
    max-width: 560px;
}

.auth-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
}

.auth-status[hidden] {
    display: none;
}

.auth-status__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: 6px;
    color: var(--sv-contrast);
    background-color: var(--sv-lime);
    border-radius: 50%;
}

.auth-status__icon .sv-icon {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
}

.auth-status__icon--danger {
    color: var(--sv-danger);
    background-color: var(--sv-danger-soft);
}

.auth-status__icon--warning {
    color: var(--sv-warning);
    background-color: var(--sv-warning-soft);
}

.auth-status__icon--muted {
    color: var(--sv-text-muted);
    background-color: var(--sv-surface-2);
}

.auth-status__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 26px;
    color: var(--sv-text);
}

.auth-status__text {
    margin: 0;
    font-size: 14px;
    line-height: 22px;
    color: var(--sv-text-body);
}

.auth-status__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

/* Bağlantı olarak kullanılan düğme (durum ekranlarının "Anasayfaya dön" gibi eylemleri) */
a.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

a.auth-button:hover,
a.auth-button:focus {
    color: var(--sv-primary-fg);
    text-decoration: none;
}

.auth-button .sv-icon,
.auth-button .sv-logo {
    width: 18px;
    height: 18px;
}

.auth-button--secondary,
a.auth-button--secondary:hover,
a.auth-button--secondary:focus {
    color: var(--sv-text);
    background-color: var(--sv-surface-2);
}

.auth-button--secondary:hover {
    background-color: var(--sv-surface-3);
}

.auth-button--whatsapp,
a.auth-button--whatsapp:hover,
a.auth-button--whatsapp:focus {
    color: var(--sv-on-brand);
    background-color: var(--sv-brand-whatsapp);
}

.auth-button--whatsapp:hover {
    filter: brightness(0.94);
}

/* Marka renginde dolu düğmede logo beyazdır */
.auth-button--whatsapp .sv-logo {
    color: var(--sv-on-brand);
}

/* Telefon doğrulandıktan sonra fişlerin gönderileceği WhatsApp hattı */
.auth-status__wa {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    margin-top: 6px;
    padding: 12px 16px;
    background-color: var(--sv-surface-2);
    border-radius: var(--sv-radius-sm);
}

.auth-status__walabel {
    font-size: 13px;
    line-height: 18px;
    color: var(--sv-text-muted);
}

.auth-status__wanumber,
.auth-status__wanumber:hover {
    font-size: 18px;
    font-weight: 700;
    line-height: 26px;
    color: var(--sv-text);
    text-decoration: none;
}

/* Ödeme sonucu: etiket / değer satırları, toplam tutar ve plan özellikleri */
.auth-factsgrid {
    display: grid;
    gap: 12px;
    width: 100%;
    margin-top: 6px;
}

/* İki kutu yan yanayken aynı yükseklikte */
.auth-factsgrid > div {
    display: flex;
    flex-direction: column;
}

.auth-factsgrid .auth-facts {
    flex: 1 1 auto;
}

.auth-facts__title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    line-height: 18px;
    color: var(--sv-text);
    text-align: left;
}

.auth-facts {
    width: 100%;
    margin: 0;
    padding: 2px 14px;
    text-align: left;
    background-color: var(--sv-surface-2);
    border-radius: var(--sv-radius-sm);
}

.auth-facts__row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 0;
    font-size: 13px;
    line-height: 20px;
}

.auth-facts__row + .auth-facts__row {
    border-top: 1px solid var(--sv-border);
}

.auth-facts dt {
    font-weight: 400;
    color: var(--sv-text-muted);
}

.auth-facts dd {
    margin: 0;
    font-weight: 600;
    color: var(--sv-text);
    text-align: right;
    overflow-wrap: anywhere;
}

.auth-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius-sm);
}

.auth-total__label {
    font-size: 14px;
    color: var(--sv-text-muted);
}

.auth-total__value {
    font-size: 22px;
    font-weight: 700;
    line-height: 28px;
    color: var(--sv-text);
}

.auth-featurebox {
    width: 100%;
    text-align: left;
}

.auth-featurebox[hidden] {
    display: none;
}

.auth-features {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 20px;
    color: var(--sv-text-muted);
}

.auth-features .sv-icon {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: var(--sv-success);
}

.auth-features strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--sv-text);
}

.auth-status__note {
    margin: 0;
    font-size: 13px;
    line-height: 20px;
    color: var(--sv-text-muted);
}

.auth-status__note a {
    font-weight: 600;
    color: var(--sv-text);
}

@media (min-width: 576px) {
    .auth-factsgrid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Yalnızca geliştirme ortamında görünen teknik ayrıntı */
.auth-status__detail {
    margin: 4px 0 0;
    font-family: var(--sv-font-mono);
    font-size: 12px;
    line-height: 18px;
    color: var(--sv-text-muted);
    word-break: break-word;
}

@media (prefers-reduced-motion: no-preference) {
    @keyframes auth-status-pop {
        0% {
            opacity: 0;
            scale: 0.4;
        }
        70% {
            opacity: 1;
            scale: 1.08;
        }
    }

    .auth-status:not([hidden]) .auth-status__icon {
        animation: auth-status-pop 0.45s var(--sv-ease-out) 0.1s backwards;
    }
}

@media (max-width: 576px) {
    /* Telefonda bütün kartlar aynı genişlikte: ekranın iki yanında 16px boşluk */
    .auth-card,
    .auth-card--register,
    .auth-card--select,
    .auth-card--terms,
    .auth-card--status {
        max-width: none;
        padding: 28px 20px;
    }

    /* "Beni hatırla" ile "Şifremi unuttum" aynı satırda kalır; sığmazsa alta iner */
    .auth-options {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .auth-hint {
        margin-top: -6px;
        margin-bottom: 14px;
    }
}
