* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    /* Mobilde dikey kaydırma (overscroll) esnemelerini ve taşmaları engeller */
    overflow-x: hidden; 
    position: relative;
}

body {
    /* dvh (dynamic viewport height) klavye açıldığında formun sıkışmasını önler */
    min-height: 100dvh; 
    font-family: Inter, Arial, sans-serif;
    background:
        radial-gradient(circle at 18% 10%, rgba(14, 165, 233, 0.14), transparent 32%),
        radial-gradient(circle at 88% 24%, rgba(147, 51, 234, 0.12), transparent 34%),
        #020712;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Küçük ekranlarda içeriğin kenarlara yapışmaması için güvenli alan */
    padding: clamp(16px, 5vw, 24px); 
}

.auth-page-container {
    display: flex;
    width: 100%;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    /* Mobilde sağdan soldan taşmayı önlemek için min ve %92 genişlik optimize edildi */
    width: 100%;
    max-width: 400px; /* Mobil ekranlar için ideal maksimum genişlik */
    padding: clamp(24px, 6vw, 32px);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(2, 10, 24, 0.96));
    border: 1px solid rgba(56, 189, 248, 0.18);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.auth-brand {
    margin-bottom: 20px;
    text-align: center;
}

.auth-brand span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin-bottom: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.12);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.32);
    font-size: 12px;
    font-weight: 800;
}

.auth-card h1 {
    margin: 0;
    /* Mobilde başlığın çok devasa olmaması için clamp alt sınırı 22px yapıldı */
    font-size: clamp(22px, 6vw, 28px);
    line-height: 1.2;
    text-align: center;
    letter-spacing: -0.02em;
}

.error {
    width: 100%;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.34);
    color: #fca5a5;
    padding: 12px 14px;
    border-radius: 12px;
    margin-top: 16px; /* H1'in altına daha kontrollü boşluk */
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.4;
}

.auth-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px; /* Mobilde parmakla basımı kolaylaştırmak için boşluk artırıldı */
    margin-top: 24px;
}

.auth-input,
.auth-btn {
    width: 100%;
    box-sizing: border-box;
}

.auth-input {
    /* Mobil dokunma standartları (Apple/Google) için ideal yükseklik olan 48px yapıldı */
    min-height: 48px; 
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: rgba(2, 6, 23, 0.92);
    color: #f8fafc;
    /* Mobilde (özellikle iOS) input odaklanınca ekranın otomatik yakınlaşmasını (zoom) engellemek için font en az 16px olmalıdır */
    font-size: 16px; 
    outline: none;
    transition: all 0.2s ease;
    /* iOS'taki varsayılan input gölgelerini sıfırlar */
    -webkit-appearance: none; 
    appearance: none;
}

.auth-input:focus {
    border-color: rgba(56, 189, 248, 0.82);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.auth-input::placeholder {
    color: #64748b;
}

/* Otomatik doldurma (Autofill) Optimizasyonu */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-input:-webkit-autofill:active {
    -webkit-text-fill-color: #f8fafc;
    caret-color: #f8fafc;
    transition: background-color 9999s ease-in-out 0s;
    box-shadow: 0 0 0 1000px #020617 inset;
    border: 1px solid rgba(56, 189, 248, 0.36);
}

.auth-btn {
    min-height: 48px; /* Kolay dokunma için 48px */
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5ff, #2563eb 48%, #9333ea);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

/* Mobilde buton basılma hissi (Active State) */
.auth-btn:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.auth-links {
    width: 100%;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.auth-links a {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    /* Küçük ekranlarda linklerin birbirine girmemesi ve rahat basılması için */
    padding: 6px 0; 
}

.auth-links a:hover {
    color: #7dd3fc;
}

/* Ekstra Küçük Ekranlar İçin İnce Ayar (Örn: iPhone SE) */
@media (max-width: 360px) {
    body {
        padding: 12px;
    }
    .auth-card {
        padding: 20px 16px;
    }
    .auth-links {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}