/* ==========================================================================
   EK Takip — Giriş / Kayıt / Şifre sıfırlama / E-posta doğrulama
   Önek: .auth-   (sol marka paneli ve iskelet: layouts/auth.html)
   ========================================================================== */
.ek-auth-body { background: var(--ek-card); }

/* ---------- Başlık ---------- */
.auth-title { font-size: clamp(1.8rem, 1.3rem + 1.2vw, 1.91rem); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 10px; }
.auth-sub { color: var(--ek-text-2); font-size: .9375rem; font-weight: 500; line-height: 1.6; margin: 0 0 24px; }
.auth-sub b { color: var(--ek-text); font-weight: 800; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: .875rem; font-weight: 800; }
.auth-back .bi { transition: transform var(--ek-fast) var(--ek-ease); }
.auth-back:hover .bi { transform: translateX(-3px); }

/* ---------- Giriş / Kayıt sekmesi ---------- */
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; margin-bottom: 22px; border-radius: 16px; background: var(--ek-subtle); }
.auth-switch a { display: flex; align-items: center; justify-content: center; height: 42px; border-radius: 12px; color: var(--ek-text-2); font-weight: 700; font-size: .875rem; transition: color var(--ek-fast), background-color var(--ek-fast), box-shadow var(--ek-fast); }
.auth-switch a:hover { color: var(--ek-text); background: color-mix(in srgb, var(--ek-card) 45%, transparent); }
.auth-switch a.active { background: var(--ek-card); color: var(--ek-text); font-weight: 800; box-shadow: 0 2px 10px rgba(11, 31, 77, .08); }

/* ---------- Butonlar & ayraç ---------- */
.auth-alt { --h: 52px; font-weight: 800; }
.auth-alt svg { width: 20px; height: 20px; flex-shrink: 0; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--ek-muted); font-size: .8125rem; font-weight: 500; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--ek-border); }
.auth-form .form-control { min-height: 52px; }
.auth-form .btn-ek-lg { margin-top: 4px; }
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-label-row a { font-size: .8125rem; font-weight: 800; margin-bottom: .5rem; }
.auth-check { align-items: flex-start; }
.auth-check .form-check-input { margin-top: 0; }
.auth-check .form-check-label { font-weight: 500; color: var(--ek-text-2); line-height: 1.5; }
.auth-check .form-check-label a { font-weight: 800; }

/* Doğrulama durumları */
.was-validated .form-control:invalid { background-image: none; border-color: var(--ek-danger); box-shadow: var(--ek-ring-danger); }
.was-validated .ek-input:has(:invalid) ~ .invalid-feedback { display: block; }
.was-validated .ek-input:has(:invalid) > .bi:first-child { color: var(--ek-danger); }
.was-validated .ek-otp input:invalid { border-color: var(--ek-danger); }

/* ---------- Alt bilgiler ---------- */
.auth-foot { text-align: center; font-size: .875rem; font-weight: 500; color: var(--ek-text-2); }
.auth-foot a { font-weight: 800; }
.auth-secure, .auth-hint, .auth-warn { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; text-align: center; font-size: .75rem; font-weight: 600; color: var(--ek-muted); }
.auth-secure .bi { color: var(--ek-success); }
.auth-secure.is-green { color: var(--ek-success); }
.auth-warn, .auth-warn a { color: var(--ek-danger); }
.auth-warn a:hover { color: var(--ek-danger-700); text-decoration: underline; }
.auth-linkbtn, .auth-resend { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ek-blue); font-weight: 800; font-size: inherit; transition: color var(--ek-fast); }
.auth-linkbtn:hover, .auth-resend:hover { color: var(--ek-blue-600); }
.auth-resend:disabled { color: var(--ek-muted); font-weight: 700; cursor: default; }
.auth-resend .bi { transition: transform .4s var(--ek-ease); }
.auth-resend:not(:disabled):hover .bi { transform: rotate(180deg); }
.auth-link-sm { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; font-size: .84rem; font-weight: 800; }

/* Kayıt promosyon şeridi */
.auth-promo { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 7px 14px; margin-bottom: 22px; border-radius: 10px; background: color-mix(in srgb, var(--ek-amber) 13%, var(--ek-card)); color: color-mix(in srgb, var(--ek-warning) 75%, var(--ek-text)); font-size: .8125rem; font-weight: 800; }

/* ---------- İkon karoları ---------- */
.auth-icon { position: relative; display: inline-grid; place-items: center; width: 68px; height: 68px; margin-bottom: 24px; border-radius: 20px; background: var(--ek-grad-blue); color: #fff; font-size: 1.75rem; box-shadow: 0 16px 32px rgba(31, 91, 255, .28); }
.auth-icon-badge { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ek-grad-orange); border: 3px solid var(--ek-card); color: #fff; font-size: .72rem; }
.auth-mail { position: relative; display: grid; place-items: center; width: 120px; height: 120px; margin-bottom: 26px; border-radius: 50%; background: color-mix(in srgb, var(--ek-blue) 11%, var(--ek-card)); }
.auth-mail > span { width: 84px; height: 84px; display: grid; place-items: center; border-radius: 50%; background: var(--ek-grad-blue); color: #fff; font-size: 2rem; box-shadow: 0 14px 30px rgba(31, 91, 255, .3); }
.auth-mail-badge { position: absolute; top: 4px; right: -4px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--ek-success); border: 3px solid var(--ek-card); color: #fff; font-size: 1rem; animation: authPop .5s var(--ek-ease) .2s both; }
.auth-done { position: relative; width: 150px; height: 150px; margin: 0 auto 28px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--ek-success) 8%, var(--ek-card)); }
.auth-done .ring { width: 116px; height: 116px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--ek-success) 24%, var(--ek-card)); }
.auth-done .ring > span { width: 88px; height: 88px; display: grid; place-items: center; border-radius: 50%; background: var(--ek-grad-green); color: #fff; font-size: 2.4rem; box-shadow: 0 14px 28px rgba(18, 183, 106, .32); animation: authPop .55s var(--ek-ease) both; }
.auth-done > i { position: absolute; border-radius: 50%; animation: authFloat 4s ease-in-out infinite; }
.auth-done .d1 { width: 10px; height: 10px; left: 6px; top: 20px; background: var(--ek-orange); }
.auth-done .d2 { width: 8px; height: 8px; right: 6px; top: 40px; background: var(--ek-blue); animation-delay: -1s; }
.auth-done .d3 { width: 7px; height: 7px; left: 16px; bottom: 26px; background: var(--ek-sky); animation-delay: -2s; }
.auth-done .d4 { width: 12px; height: 12px; right: 18px; bottom: 14px; background: var(--ek-amber); animation-delay: -3s; }
@keyframes authPop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } to { transform: none; opacity: 1; } }
@keyframes authFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ---------- Şifre gücü & kurallar ---------- */
.auth-strength { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.auth-strength .ek-strength { flex: 1; }
.auth-form .ek-strength span { height: 4px; }
.auth-pw-label { min-width: 54px; text-align: right; font-size: .75rem; font-weight: 800; color: var(--ek-muted); }
.auth-rules-inline { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }
.auth-rules-inline .ek-rule { gap: 5px; font-size: .75rem; }
.auth-rules-inline .ek-rule i { width: auto; height: auto; background: none !important; color: var(--ek-muted); font-size: .72rem; }
.auth-rules-inline .ek-rule.ok { color: var(--ek-text-2); }
.auth-rules-inline .ek-rule.ok i { color: var(--ek-success); }
.auth-rules-inline .ek-rule:not(.ok) i::before { content: "\F28A"; }
.auth-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 18px 0 24px; padding: 14px 16px; border-radius: 16px; background: var(--ek-bg); }
.auth-rules .ek-rule i { flex-shrink: 0; }

/* Şifre tekrar eşleşmesi */
.auth-match-ic { position: absolute; right: 16px; z-index: 2; color: var(--ek-success); font-size: 1.2rem; opacity: 0; transform: scale(.6); transition: opacity var(--ek-fast), transform var(--ek-fast) var(--ek-ease); pointer-events: none; }
.auth-match .ek-input > .form-control { padding-right: 46px; }
.auth-match:has(.is-valid) .auth-match-ic { opacity: 1; transform: none; }
.auth-match-ok, .auth-match-bad { display: none; align-items: center; gap: 6px; margin-top: 8px; font-size: .78rem; font-weight: 700; }
.auth-match-ok { color: var(--ek-success); }
.auth-match-bad { color: var(--ek-danger); }
.auth-match:has(.form-control.is-valid) .auth-match-ok { display: flex; }
.auth-match:has(.form-control.is-invalid) .auth-match-bad { display: flex; }

/* ---------- Bağlantı adımları ---------- */
.auth-steps { list-style: none; display: grid; gap: 14px; margin: 0 0 22px; padding: 18px; border-radius: 18px; background: var(--ek-bg); border: 1px solid var(--ek-border); }
.auth-steps li { display: flex; align-items: center; gap: 12px; }
.auth-steps .n { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--ek-card); color: var(--ek-blue); font-weight: 800; font-size: .8125rem; box-shadow: var(--ek-shadow-xs); }
.auth-steps li:first-child .n { background: var(--ek-grad-blue); color: #fff; }
.auth-steps b { display: block; font-size: .875rem; font-weight: 800; }
.auth-steps b a { color: var(--ek-text); }
.auth-steps b a:hover { color: var(--ek-blue); }
.auth-steps small { display: block; font-size: .75rem; font-weight: 500; color: var(--ek-muted); }

/* ---------- OTP ---------- */
.auth-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 26px; }
.auth-progress > div { font-size: .78rem; font-weight: 600; color: var(--ek-muted); }
.auth-progress > div::before { content: ""; display: block; height: 4px; margin-bottom: 10px; border-radius: 99px; background: var(--ek-border); }
.auth-progress .done { color: var(--ek-success); font-weight: 800; }
.auth-progress .done::before { background: var(--ek-success); }
.auth-progress .current { color: var(--ek-blue); font-weight: 800; }
.auth-progress .current::before { background: var(--ek-grad-blue); }
.auth-otp-set { border: 0; padding: 0; margin: 0; min-width: 0; }
.auth-otp input::placeholder { color: var(--ek-border-strong); font-weight: 500; }
.auth-otp input:focus::placeholder { color: transparent; }
.auth-otp input { caret-color: var(--ek-blue); }
.auth-otp-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 22px; font-size: .8125rem; font-weight: 600; color: var(--ek-text-2); }
.auth-otp-meta > span { display: inline-flex; align-items: center; gap: 7px; }
.auth-otp-meta .bi-clock { color: var(--ek-orange); }
.auth-otp-meta b { color: var(--ek-orange); font-weight: 800; font-variant-numeric: tabular-nums; }
.auth-otp-meta.is-expired .bi-clock, .auth-otp-meta.is-expired b { color: var(--ek-danger); }

/* ---------- Şifre güncellendi bilgi tablosu ---------- */
.auth-kv { margin: 22px 0 24px; padding: 2px 18px; border-radius: 16px; background: var(--ek-bg); border: 1px solid var(--ek-border); }
.auth-kv > div { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.auth-kv > div + div { border-top: 1px solid var(--ek-border); }
.auth-kv dt { display: flex; align-items: center; gap: 9px; font-size: .875rem; font-weight: 500; color: var(--ek-muted); }
.auth-kv dd { margin: 0 0 0 auto; font-size: .875rem; font-weight: 800; text-align: right; }

@media (max-width: 575.98px) {
  .auth-rules { grid-template-columns: 1fr; }
  .auth-otp-meta { flex-wrap: wrap; }
  .auth-kv { padding: 2px 14px; }
  .auth-kv dd { font-size: .8125rem; }
}

/* ---------- Sunucu bağlantılı durumlar (giriş uyarısı, 2FA adımı, geliştirme notu) ---------- */
.auth-alert { margin-bottom: 20px; font-size: .875rem; font-weight: 600; line-height: 1.5; }
.auth-alert > .bi { flex-shrink: 0; }
.auth-alert.is-info { background: color-mix(in srgb, var(--ek-blue) 8%, var(--ek-card)); color: var(--ek-text); }
.auth-alert.is-info > .bi { color: var(--ek-blue); }
.auth-dev { justify-content: flex-start; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--ek-amber) 55%, var(--ek-border)); background: color-mix(in srgb, var(--ek-amber) 7%, var(--ek-card)); color: var(--ek-text-2); text-align: left; line-height: 1.5; }
.auth-dev .bi { color: var(--ek-warning); margin-top: 1px; }
.auth-dev a { font-weight: 800; }
.auth-promo-ref { background: color-mix(in srgb, var(--ek-blue) 9%, var(--ek-card)); color: var(--ek-blue-600); }
.auth-otp.is-invalid input { border-color: var(--ek-danger); box-shadow: var(--ek-ring-danger); }
[data-twofa-step] .auth-icon .bi-shield-lock { font-size: 1.6rem; }
