/* ============================================================
   Webisyo ERP/PMS - Kurumsal Giriş Teması
   Mavi + nötr tonlar, light/dark, ince animasyonlar
   ============================================================ */

:root {
  --brand: #2680eb;
  --brand-600: #1f6fd1;
  --brand-700: #1a5fb4;
  --brand-soft: rgba(38, 128, 235, 0.12);
  --brand-ring: rgba(38, 128, 235, 0.35);

  --bg: #f4f7fc;
  --bg-grad-1: #eef4ff;
  --bg-grad-2: #f7fafe;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e9f2;
  --border-strong: #d3dbe8;

  --text: #1f2a44;
  --text-muted: #6b7791;
  --text-faint: #9aa4bb;

  --danger: #e5484d;
  --success: #2f9e44;
  --warning: #f59f00;

  --shadow-sm: 0 1px 2px rgba(20, 40, 80, 0.06);
  --shadow-md: 0 10px 30px -12px rgba(20, 50, 110, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(20, 50, 110, 0.28);

  --radius: 14px;
  --radius-sm: 10px;
}

html[data-theme="dark"] {
  --brand: #4c9aff;
  --brand-600: #3d8bf2;
  --brand-700: #357be0;
  --brand-soft: rgba(76, 154, 255, 0.16);
  --brand-ring: rgba(76, 154, 255, 0.4);

  --bg: #0b1120;
  --bg-grad-1: #0d1626;
  --bg-grad-2: #0a0f1c;
  --surface: #121a2b;
  --surface-2: #182238;
  --border: #243149;
  --border-strong: #2e3d5a;

  --text: #e8eefc;
  --text-muted: #97a3bd;
  --text-faint: #6b7793;

  --shadow-md: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--brand-soft), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 96px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease, color 0.3s ease;
}

/* ---- Animated floating nodes background ---- */
.bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-decor span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--brand), transparent 70%);
  opacity: 0.12;
  animation: float 18s ease-in-out infinite;
}
.bg-decor span:nth-child(1) { width: 380px; height: 380px; top: -120px; left: -80px; animation-delay: 0s; }
.bg-decor span:nth-child(2) { width: 260px; height: 260px; bottom: 8%; right: -60px; animation-delay: -4s; }
.bg-decor span:nth-child(3) { width: 160px; height: 160px; top: 22%; right: 18%; animation-delay: -8s; opacity: 0.08; }
.bg-decor span:nth-child(4) { width: 120px; height: 120px; bottom: 26%; left: 14%; animation-delay: -12s; opacity: 0.1; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -28px) scale(1.06); }
}

/* ---- Top bar ---- */
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 18px 26px;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, border-color 0.2s ease, background 0.2s ease;
  text-decoration: none;
}
.pill-btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.pill-btn svg { width: 16px; height: 16px; }

/* language dropdown */
.lang-wrap { position: relative; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  min-width: 150px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}
.lang-wrap.open .lang-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
}
.lang-menu a:hover { background: var(--surface-2); }
.flag { font-size: 16px; line-height: 1; }

/* ---- Layout ---- */
.main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 36px 34px 30px;
  animation: cardIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Brand / logo ---- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
}
.brand-logo {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--brand);
}
.brand-logo .dots {
  position: relative;
  width: 26px;
  height: 30px;
}
.brand-logo .dots i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: dotPulse 2.2s ease-in-out infinite;
}
.brand-logo .dots i:nth-child(1) { top: 0; left: 2px; animation-delay: 0s; }
.brand-logo .dots i:nth-child(2) { top: 4px; left: 14px; width: 9px; height: 9px; animation-delay: 0.3s; }
.brand-logo .dots i:nth-child(3) { top: 13px; left: 6px; width: 5px; height: 5px; animation-delay: 0.6s; }

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 1; }
}
.brand-tag {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
}

/* ---- Headings ---- */
.auth-head { margin-bottom: 22px; text-align: left; }
.auth-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.2px; }
.auth-head p { margin-top: 6px; font-size: 13.5px; color: var(--text-muted); line-height: 1.5; }
.auth-head p b { color: var(--text); font-weight: 600; }

/* ---- Form ---- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}
.field label .req { color: var(--danger); margin-left: 2px; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .lead-icon,
.input-wrap .trail-btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}
.input-wrap .lead-icon { left: 12px; pointer-events: none; }
.input-wrap .trail-btn {
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.input-wrap .trail-btn:hover { color: var(--brand); background: var(--brand-soft); }
.input-wrap svg { width: 18px; height: 18px; }

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input.has-lead { padding-left: 40px; }
.input.has-trail { padding-right: 42px; }
.input::placeholder { color: var(--text-faint); }
.input:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--brand-ring);
}

/* ---- Row: remember / forgot ---- */
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 18px;
  flex-wrap: wrap;
  gap: 8px;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.checkbox input:checked { background: var(--brand); border-color: var(--brand); }
.checkbox input:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s;
}
.link:hover { color: var(--brand-700); text-decoration: underline; }

/* ---- Button ---- */
.btn {
  width: 100%;
  height: 48px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--brand), var(--brand-600));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 18px -8px var(--brand-ring);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover { filter: brightness(1.04); box-shadow: 0 12px 24px -8px var(--brand-ring); }
.btn:active { transform: translateY(1px); }
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
}
.btn:hover::after { animation: shine 0.9s ease; }
@keyframes shine { to { left: 130%; } }

.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.btn.secondary:hover { border-color: var(--border-strong); filter: none; }

/* ---- Back link ---- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
}
.back-link:hover { color: var(--brand); gap: 9px; }
.back-link svg { width: 16px; height: 16px; }

/* ---- OTP / code inputs ---- */
.otp-group {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 6px 0 4px;
}
.otp-group input {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.otp-group input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-ring);
  transform: translateY(-2px);
}
.otp-group input.filled { border-color: var(--brand); background: var(--surface); }

.resend-row {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 18px;
}
.resend-row .link { font-weight: 600; }
.resend-row .timer { font-weight: 700; color: var(--text); }

/* ---- QR section ---- */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  margin-bottom: 18px;
}
.qr-frame {
  position: relative;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.qr-frame img { display: block; width: 168px; height: 168px; }
/* scanning animation line */
.qr-frame::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  border-radius: 2px;
  animation: scanline 2.4s ease-in-out infinite;
}
@keyframes scanline {
  0% { transform: translateY(0); opacity: 0.2; }
  50% { transform: translateY(144px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.2; }
}

.secret-key {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.copy-btn {
  border: none;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 7px;
  padding: 5px 7px;
  cursor: pointer;
  display: inline-flex;
  transition: background 0.2s;
}
.copy-btn:hover { background: var(--brand-ring); }
.copy-btn svg { width: 15px; height: 15px; }

.steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.steps li .num {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- password strength ---- */
.pw-meter { margin-top: 8px; }
.pw-bars { display: flex; gap: 6px; margin-bottom: 6px; }
.pw-bars span {
  flex: 1;
  height: 5px;
  border-radius: 4px;
  background: var(--border);
  transition: background 0.3s;
}
.pw-label { font-size: 12px; color: var(--text-muted); }
.pw-meter[data-level="1"] .pw-bars span:nth-child(1) { background: var(--danger); }
.pw-meter[data-level="2"] .pw-bars span:nth-child(-n+2) { background: var(--warning); }
.pw-meter[data-level="3"] .pw-bars span:nth-child(-n+3) { background: var(--warning); }
.pw-meter[data-level="4"] .pw-bars span { background: var(--success); }

/* divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* alt 2fa link */
.alt-method {
  text-align: center;
  margin-top: 16px;
  font-size: 13.5px;
}

/* ---- Footer ---- */
.footer {
  position: relative;
  z-index: 3;
  text-align: center;
  padding: 26px 16px 30px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.footer .secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-weight: 500;
}
.footer .secure svg { width: 14px; height: 14px; color: var(--success); }

/* ---- bottom wave ---- */
.wave {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  pointer-events: none;
  line-height: 0;
}
.wave svg { width: 100%; height: 130px; display: block; }
.wave .w1 { fill: var(--brand); opacity: 0.18; }
.wave .w2 { fill: var(--brand); opacity: 0.9; }
html[data-theme="dark"] .wave .w2 { opacity: 0.5; }

@media (max-width: 480px) {
  .auth-card { padding: 28px 22px 24px; }
  .otp-group input { max-width: none; }
  .wave svg { height: 90px; }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { animation: none !important; transition: none !important; }
}

/* ---- Panel auth extras ---- */
.brand-img {
  display: block;
  max-width: 220px;
  height: auto;
}

.auth-step { display: none; }
.auth-step.is-active { display: block; }

.auth-head--center { text-align: center; }
.auth-head--center h1,
.auth-head--center p { text-align: center; }

.mail-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.info-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
  text-align: center;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-row .btn { flex: 1; }

.auth-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
}
.auth-loader.is-visible { display: flex; }
.auth-loader span {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

.lang-menu a.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.error-box {
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.25);
  color: var(--danger);
  text-align: center;
  margin-bottom: 16px;
}

.qr-scan-toggle {
  display: inline-block;
  margin-top: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.qr-manual-panel {
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-strong);
  text-align: left;
}

.qr-manual-panel[hidden] {
  display: none !important;
}

.manual-hint {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.manual-copy-block {
  margin-bottom: 12px;
}

.manual-copy-block:last-child {
  margin-bottom: 0;
}

.manual-copy-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.manual-copy-box {
  width: 100%;
  justify-content: space-between;
  gap: 10px;
}

.manual-copy-box span {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}
