/* ============================================================
   StarkCDN - Giriş ekranı (index.php / auth.php)
   Tüm sınıflar "sa-" önekli; Tailwind'e bağımlı değildir.
   Görsel dil: dashboard.php (cam kart, lacivert zemin, mavi vurgu)
   ============================================================ */

:root {
    --sa-bg: #0a0f1e;
    --sa-cyan: #00f0ff;
    --sa-blue: #3b82f6;
    --sa-text: #e5e7eb;
    --sa-muted: #9ca3af;
    --sa-subtle: #6b7280;
    --sa-border: rgba(255, 255, 255, 0.08);
    --sa-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sa-radius: 0.75rem;
}

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

html { height: 100%; -webkit-text-size-adjust: 100%; }

.sa-body {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    background: var(--sa-bg);
    color: var(--sa-text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.sa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] { display: none !important; }

/* --- Dekoratif arka plan --- */
.sa-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.sa-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 48px 48px;
    background-position: center center;
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 15%, transparent 75%);
    mask-image: radial-gradient(ellipse 60% 55% at 50% 45%, #000 15%, transparent 75%);
}
.sa-glow {
    position: absolute;
    border-radius: 9999px;
    filter: blur(110px);
    will-change: transform;
}
.sa-glow-cyan {
    width: 520px;
    height: 520px;
    top: 50%;
    left: 50%;
    margin: -380px 0 0 -420px;
    background: rgba(0, 240, 255, 0.11);
    animation: sa-drift-a 22s ease-in-out infinite alternate;
}
.sa-glow-blue {
    width: 620px;
    height: 620px;
    top: 50%;
    left: 50%;
    margin: -180px 0 0 -160px;
    background: rgba(59, 130, 246, 0.13);
    animation: sa-drift-b 26s ease-in-out infinite alternate;
}
@keyframes sa-drift-a {
    from { transform: translate3d(-40px, -20px, 0) scale(1); }
    to   { transform: translate3d(60px, 40px, 0) scale(1.12); }
}
@keyframes sa-drift-b {
    from { transform: translate3d(40px, 30px, 0) scale(1.05); }
    to   { transform: translate3d(-60px, -40px, 0) scale(0.95); }
}

/* --- Yerleşim --- */
.sa-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    max-width: 26.5rem;
    margin: 0 auto;
    padding: max(2.5rem, env(safe-area-inset-top)) 1.25rem max(1.75rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: sa-rise 0.6s var(--sa-ease) backwards;
}
@keyframes sa-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* --- Marka --- */
.sa-brand { text-align: center; margin-bottom: 1.75rem; }
.sa-logo {
    position: relative;
    display: inline-block;
    margin-bottom: 1.125rem;
}
.sa-logo::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 1.5rem;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.28), transparent 70%);
    filter: blur(10px);
}
.sa-logo img {
    position: relative;
    display: block;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
}
.sa-wordmark {
    margin: 0;
    font-size: 1.875rem;
    line-height: 2.25rem;
    letter-spacing: -0.01em;
}
.sa-wordmark-stark { font-weight: 700; letter-spacing: -0.025em; color: #fff; }
.sa-wordmark-cdn { margin-left: 3px; font-weight: 600; letter-spacing: 0.12em; color: var(--sa-cyan); }
.sa-tagline {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    color: var(--sa-muted);
}

/* --- Cam kart --- */
.sa-card {
    position: relative;
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 1.25rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
    border: 1px solid var(--sa-border);
    box-shadow:
        0 30px 80px -24px rgba(0, 0, 0, 0.75),
        0 0 0 1px rgba(59, 130, 246, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
}
.sa-card::before {
    /* üst kenarda ince camgöbeği ışık çizgisi */
    content: "";
    position: absolute;
    top: -1px;
    left: 18%;
    right: 18%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.55), transparent);
}
.sa-card-title {
    margin: 0 0 1.25rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em;
}

/* --- Hata kutusu --- */
.sa-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin: 0 0 1.125rem;
    padding: 0.75rem 0.875rem;
    border-radius: var(--sa-radius);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fecaca;
    font-size: 0.875rem;
    line-height: 1.4;
    animation: sa-pop 0.2s var(--sa-ease);
}
.sa-alert-icon { width: 1.125rem; height: 1.125rem; flex-shrink: 0; margin-top: 1px; color: #f87171; }
@keyframes sa-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

/* --- Form --- */
.sa-form { display: flex; flex-direction: column; gap: 1rem; }
.sa-field { display: flex; flex-direction: column; gap: 0.4375rem; }
.sa-label { font-size: 0.8125rem; font-weight: 500; color: #d1d5db; }
.sa-input-wrap { position: relative; }
.sa-input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    width: 1.125rem;
    height: 1.125rem;
    transform: translateY(-50%);
    color: var(--sa-subtle);
    pointer-events: none;
    transition: color 0.2s ease;
}
.sa-input {
    width: 100%;
    height: 2.875rem;
    padding: 0 0.875rem 0 2.625rem;
    border-radius: var(--sa-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    font: inherit;
    font-size: 1rem; /* iOS yakınlaştırmasını önler */
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.sa-input-has-toggle { padding-right: 3rem; }
.sa-input::placeholder { color: #5b6474; }
.sa-input:hover { border-color: rgba(255, 255, 255, 0.18); }
.sa-input:focus {
    outline: none;
    border-color: rgba(0, 240, 255, 0.55);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.14);
}
.sa-input-wrap:focus-within .sa-input-icon { color: var(--sa-cyan); }
.sa-input[aria-invalid="true"] { border-color: rgba(248, 113, 113, 0.6); }
.sa-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18); }
.sa-input:-webkit-autofill,
.sa-input:-webkit-autofill:hover,
.sa-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #121a2c inset;
    transition: background-color 9999s ease-out 0s;
}

.sa-toggle {
    position: absolute;
    right: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--sa-muted);
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.sa-toggle svg { width: 1.125rem; height: 1.125rem; }
.sa-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.sa-toggle:focus { outline: none; }
.sa-toggle:focus-visible { outline: 2px solid var(--sa-cyan); outline-offset: 0; }

/* --- Birincil buton --- */
.sa-btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 2.875rem;
    margin-top: 0.375rem;
    padding: 0 1rem;
    border: 0;
    border-radius: var(--sa-radius);
    background: linear-gradient(180deg, #4f8ff7, #2f6fe0);
    color: #fff;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 28px -10px rgba(59, 130, 246, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--sa-ease), opacity 0.2s ease;
}
.sa-btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #5b98f8, #3b7bea);
    box-shadow: 0 14px 34px -10px rgba(59, 130, 246, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
}
.sa-btn-primary:active:not(:disabled) { transform: translateY(0); }
.sa-btn-primary:focus { outline: none; }
.sa-btn-primary:focus-visible { outline: 2px solid var(--sa-cyan); outline-offset: 3px; }
.sa-btn-primary:disabled { cursor: not-allowed; opacity: 0.75; }
.sa-btn-primary .sa-spinner { display: none; }
.sa-btn-primary.is-loading .sa-spinner { display: inline-block; }

.sa-spinner {
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: sa-spin 0.7s linear infinite;
}
@keyframes sa-spin { to { transform: rotate(360deg); } }

/* --- Google --- */
.sa-divider {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 1.375rem 0 1.125rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sa-subtle);
}
.sa-divider::before,
.sa-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}
/* Google: görünen yüz bizim tasarımımız (.sa-google-face); Google'ın resmi butonu
   (#google-btn iframe) tam üstünde neredeyse şeffaf durur ve tıklamayı o alır.
   Hover/odak durumları, iframe torunu olduğu için slot'un :hover/:focus-within'i ile verilir. */
.sa-google-slot {
    position: relative;
    height: 2.875rem;
    border-radius: var(--sa-radius);
}
.sa-google-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--sa-radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--sa-text);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    pointer-events: none;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease, transform 0.2s var(--sa-ease);
}
.sa-google-logo {
    flex-shrink: 0;
    padding: 3px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.sa-google-slot:hover .sa-google-face {
    border-color: rgba(0, 240, 255, 0.45);
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.09), rgba(59, 130, 246, 0.05));
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.12), 0 8px 24px -10px rgba(0, 240, 255, 0.45);
    transform: translateY(-1px);
}
.sa-google-slot:focus-within .sa-google-face {
    outline: 2px solid var(--sa-cyan);
    outline-offset: 3px;
}
.sa-google-slot:active .sa-google-face { transform: translateY(0); }

/* Resmi Google butonu: yüzün tam üstünde, görünmez ama tıklanabilir.
   (Tamamen 0 opaklık bazı tarayıcılarda tıklamayı engelleyebildiği için 0.01.) */
.sa-google-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--sa-radius);
    opacity: 0.01;
    color-scheme: normal;
    cursor: pointer;
}
/* GIS yapısı: <div.wrapper> <div>(yedek görünüm)</div> <iframe>(asıl buton)</iframe> </div>
   Sarmalayıcı slot'u kaplar, iframe tam üstüne sabitlenir, yedek görünüm gizlenir. */
.sa-google-btn > div {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.sa-google-btn > div > div { visibility: hidden !important; }
.sa-google-btn iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
}

.sa-google-busy {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--sa-radius);
    background: rgba(10, 15, 30, 0.72);
}
@media (prefers-reduced-motion: reduce) {
    .sa-google-face { transition: none; }
    .sa-google-slot:hover .sa-google-face { transform: none; }
}
.sa-google-section.is-busy .sa-google-busy { display: flex; }
.sa-google-section.is-busy .sa-google-btn { pointer-events: none; }

/* --- Alt bilgi --- */
.sa-note {
    margin: 1.5rem 0 0;
    padding-top: 1.125rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--sa-muted);
    text-align: center;
}
.sa-link {
    color: #67e8f9;
    text-decoration: none;
    border-radius: 0.25rem;
    white-space: nowrap;
    transition: color 0.2s ease;
}
.sa-link:hover { color: #a5f3fc; text-decoration: underline; text-underline-offset: 3px; }
.sa-link:focus { outline: none; }
.sa-link:focus-visible,
.sa-link-muted:focus-visible { outline: 2px solid var(--sa-cyan); outline-offset: 2px; }

.sa-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--sa-subtle);
}
.sa-link-muted {
    color: var(--sa-muted);
    text-decoration: none;
    border-radius: 0.25rem;
    transition: color 0.2s ease;
}
.sa-link-muted:hover { color: #fff; }
.sa-link-muted:focus { outline: none; }

/* --- Daha geniş ekranlar --- */
@media (min-width: 640px) {
    .sa-card { padding: 2rem 2rem 1.75rem; }
    .sa-wordmark { font-size: 2.125rem; line-height: 2.5rem; }
}

/* Kısa ekranlar (yatay telefon): dikeyde ortalamayı bırak, kaydırılabilsin */
@media (max-height: 640px) {
    .sa-shell { justify-content: flex-start; }
}

/* --- Hareket azaltma tercihi --- */
@media (prefers-reduced-motion: reduce) {
    .sa-glow,
    .sa-shell,
    .sa-alert { animation: none !important; }
    .sa-spinner { animation-duration: 1.6s; }
    .sa-btn-primary,
    .sa-btn-primary:hover:not(:disabled) { transition: none; transform: none; }
}
