/* fl-auth.css — Sıfırdan tasarlanan giriş/kayıt ekranı.
 * Hedef: mobil-first, normal page scroll (overflow-hidden parent'ları
 * by-pass eder), modern glass card, klavye/safe-area dostu.
 */

body.fl-auth-active,
body.fl-auth-active #app,
body.fl-auth-active .app-layout,
html:has(body.fl-auth-active) {
  height: auto !important;
  min-height: 100vh !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-x: hidden !important;
}

/* Auth açıkken tüm fixed app öğelerini gizle */
body.fl-auth-active .gb-topbar,
body.fl-auth-active .fl-bottom-nav,
body.fl-auth-active .tw-fab,
body.fl-auth-active .coach-bubble,
body.fl-auth-active .coach-popup,
body.fl-auth-active #fl-bottom-nav { display: none !important; }

/* Eski auth-page ve modal vs gizlensin (çakışmayı önle) */
body.fl-auth-active .auth-page { display: none !important; }

/* ── Container ────────────────────────────────────────────────────── */
.fl-auth {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 28px 16px calc(40px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #f8f9fc 0%, #ffffff 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  color: #0F172A;
  box-sizing: border-box;
}
.dark-mode .fl-auth {
  background: linear-gradient(180deg, #0a0a0c 0%, #18181b 100%);
  color: #ffffff;
}

/* Dekoratif arka plan ışıkları */
.fl-auth::before,
.fl-auth::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.fl-auth::before {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #6366F1 0%, transparent 70%);
  top: -80px; left: -60px;
}
.fl-auth::after {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #8B5CF6 0%, transparent 70%);
  top: 30%; right: -100px;
}
.dark-mode .fl-auth::before,
.dark-mode .fl-auth::after { opacity: 0.22; }

/* ── Brand (logo) ─────────────────────────────────────────────────── */
.fl-auth-brand {
  position: relative; z-index: 1;
  text-align: center;
  margin: 8px 0 22px;
}
.fl-auth-wordmark {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.fl-auth-wordmark span:first-child { color: #6366F1; font-weight: 800; }
.fl-auth-wordmark span:last-child { color: #475569; font-weight: 600; }
.dark-mode .fl-auth-wordmark span:last-child { color: #94a3b8; }
.fl-auth-tagline {
  font-size: 12.5px;
  color: #94a3b8;
  margin-top: 6px;
  font-weight: 500;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.fl-auth-card {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 20px;
  padding: 24px 22px 28px;
  box-shadow:
    0 18px 50px rgba(99, 102, 241, 0.10),
    0 2px 10px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}
.dark-mode .fl-auth-card {
  background: #18181b;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.45),
    0 2px 10px rgba(99, 102, 241, 0.08);
}

/* ── Tab switcher (Giriş / Kayıt) ─────────────────────────────────── */
.fl-auth-tabs {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 22px;
}
.dark-mode .fl-auth-tabs { background: #27272a; }
.fl-auth-tab {
  flex: 1;
  padding: 11px 10px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: #64748b;
  cursor: pointer;
  transition: all .18s cubic-bezier(.4,0,.2,1);
}
.dark-mode .fl-auth-tab { color: #94a3b8; }
.fl-auth-tab.active {
  background: #ffffff;
  color: #0F172A;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.dark-mode .fl-auth-tab.active {
  background: #3f3f46;
  color: #ffffff;
}

/* ── Form ─────────────────────────────────────────────────────────── */
.fl-auth-form { display: none; flex-direction: column; gap: 14px; }
.fl-auth-form.active { display: flex; }
.fl-auth-row { display: flex; gap: 10px; }
.fl-auth-row > .fl-auth-field { flex: 1; min-width: 0; }

.fl-auth-field { display: flex; flex-direction: column; gap: 6px; }
.fl-auth-field-head { display: flex; justify-content: space-between; align-items: center; }
.fl-auth-field label,
.fl-auth-field-head label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #64748b;
}
.dark-mode .fl-auth-field label,
.dark-mode .fl-auth-field-head label { color: #94a3b8; }

/* Input ortak — input, select, password container */
.fl-auth-field input,
.fl-auth-field select,
.fl-auth-pw {
  width: 100%;
  min-height: 48px;
  padding: 13px 14px;
  border: 1.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: #0F172A;
  background: #fafbff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
  outline: none;
  box-sizing: border-box;
}
.dark-mode .fl-auth-field input,
.dark-mode .fl-auth-field select,
.dark-mode .fl-auth-pw {
  background: #27272a;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.08);
}
.fl-auth-field input::placeholder { color: #94a3b8; font-weight: 400; }
.dark-mode .fl-auth-field input::placeholder { color: #64748b; }

.fl-auth-field input:hover,
.fl-auth-field select:hover { border-color: rgba(99, 102, 241, 0.3); }
.fl-auth-field input:focus,
.fl-auth-field select:focus,
.fl-auth-pw:focus-within {
  border-color: #6366F1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
  background: #ffffff;
}
.dark-mode .fl-auth-field input:focus,
.dark-mode .fl-auth-field select:focus,
.dark-mode .fl-auth-pw:focus-within {
  background: #18181b;
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.18);
}

/* Select chevron */
.fl-auth-field select {
  cursor: pointer;
  padding-right: 38px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'><path fill='none' stroke='%236366F1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1l6 7 6-7'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 10px;
}
.fl-auth-field select option { color: #0F172A; background: #ffffff; }
.dark-mode .fl-auth-field select option { color: #ffffff; background: #27272a; }

/* Password — input + toggle button */
.fl-auth-pw {
  display: flex;
  align-items: center;
  padding: 0;
  gap: 0;
}
.fl-auth-pw input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  outline: none;
  height: 100%;
  min-height: 48px;
  padding: 13px 14px;
  font-size: 15px;
  color: inherit;
  box-shadow: none !important;
}
.fl-auth-pw-toggle {
  width: 44px; height: 44px;
  margin-right: 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.fl-auth-pw-toggle:hover { color: #6366F1; }

/* Beni hatırla satırı */
.fl-auth-remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #475569; font-weight: 500;
  cursor: pointer; user-select: none;
}
.dark-mode .fl-auth-remember { color: #cbd5e1; }
.fl-auth-remember input { width: 18px; height: 18px; cursor: pointer; accent-color: #6366F1; }

/* Forgot link */
.fl-auth-forgot {
  font-size: 11.5px; font-weight: 600;
  color: #6366F1; text-decoration: none;
  text-transform: none; letter-spacing: 0;
}
.fl-auth-forgot:hover { text-decoration: underline; }

/* Submit button */
.fl-auth-submit {
  margin-top: 6px;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.1px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.32);
  transition: transform .15s, box-shadow .15s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.fl-auth-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99, 102, 241, 0.40); }
.fl-auth-submit:active { transform: translateY(0); }
.fl-auth-submit:disabled { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }

/* Guest continue / footer link */
.fl-auth-guest {
  margin-top: 16px;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  text-decoration: underline;
  text-decoration-color: rgba(100, 116, 139, 0.3);
  text-underline-offset: 4px;
}
.fl-auth-guest:hover { color: #6366F1; text-decoration-color: #6366F1; }

.fl-auth-legal {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  max-width: 360px;
  margin: 16px auto 0;
  line-height: 1.55;
  padding: 0 20px;
}
.fl-auth-legal a { color: #6366F1; text-decoration: underline; text-underline-offset: 2px; }

/* Notice (admin'in koyduğu duyuru) */
.fl-auth-notice {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  color: #4338ca;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  margin-bottom: 14px;
}
.dark-mode .fl-auth-notice { color: #a5b4fc; }

/* ── Mobile padding ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .fl-auth { padding: 20px 12px calc(60px + env(safe-area-inset-bottom, 0px)); }
  .fl-auth-card { padding: 22px 18px 24px; border-radius: 18px; }
  .fl-auth-row { flex-direction: column; gap: 14px; }
}

/* Tablet+ daha geniş kart */
@media (min-width: 800px) {
  .fl-auth { padding-top: 60px; }
  .fl-auth-card { max-width: 460px; padding: 32px 30px 34px; }
}
