/* ============================================================
   BitTool.ai — Auth (login) page
   ============================================================ */

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -340px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px; height: 760px;
  background:
    radial-gradient(560px 340px at 46% 42%, var(--accent-soft), transparent 70%),
    radial-gradient(480px 300px at 60% 34%, rgba(34, 211, 238, 0.06), transparent 70%);
  pointer-events: none;
}

.auth-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}
.auth-header .actions { display: flex; gap: 4px; }

.auth-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px 60px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 30px;
}
@media (max-width: 480px) {
  .auth-card { border: none; background: transparent; box-shadow: none; padding: 12px 4px; }
}

.auth-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-logo img { width: 44px; height: 44px; }

.auth-title { text-align: center; font-size: var(--text-xl); font-weight: 650; letter-spacing: -0.02em; }
.auth-subtitle { margin-top: 7px; text-align: center; color: var(--text-2); font-size: var(--text-base); }

.auth-providers { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }

.btn-provider {
  height: 44px;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-base);
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn-provider:hover { background: var(--surface-2); }
.btn-provider svg, .btn-provider img { width: 18px; height: 18px; flex: none; }

#googleBtnHost { min-height: 44px; display: flex; justify-content: center; }
#googleBtnHost > div { width: 100% !important; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--text-3);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form .input { height: 44px; border-radius: var(--radius-md); }

.auth-terms {
  margin-top: 22px;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.6;
}
.auth-terms a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; }

.auth-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.auth-error svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

.auth-notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--info-soft);
  color: var(--info);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.auth-notice svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }

/* Turnstile */
.captcha-box { display: flex; justify-content: center; margin-top: 4px; min-height: 0; }
.captcha-hint { text-align: center; font-size: var(--text-xs); color: var(--text-3); }

/* OTP step */
.otp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: var(--text-sm);
  background: none; border: none; cursor: pointer;
  padding: 4px 6px; margin-left: -6px;
  border-radius: var(--radius-xs);
}
.otp-back:hover { color: var(--text); background: var(--surface-2); }
.otp-back svg { width: 14px; height: 14px; }

.otp-email { font-weight: 600; color: var(--text); word-break: break-all; }

.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 22px 0 4px;
}
.otp-digit {
  width: 46px;
  height: 54px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  -moz-appearance: textfield;
}
.otp-digit::-webkit-outer-spin-button, .otp-digit::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.otp-digit:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-soft); }
.otp-digit.is-invalid { border-color: var(--danger); }
@media (max-width: 400px) { .otp-digit { width: 40px; height: 48px; } }

.otp-resend {
  margin-top: 16px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-3);
}
.otp-resend button {
  background: none; border: none; padding: 2px 4px;
  color: var(--accent-text); font-weight: 550; font-size: var(--text-sm);
  cursor: pointer; border-radius: var(--radius-xs);
}
.otp-resend button:disabled { color: var(--text-3); cursor: default; font-weight: 450; }

/* ---------- /auth/native — the native app sign-in bridge ---------- */
/* Rendered inside a system authentication sheet: one column, ~375 px, no
   navigation, and a dark palette that does not flash white on arrival. */
.na-spinner {
  width: 26px; height: 26px; margin: 8px auto 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: na-spin 0.7s linear infinite;
}
@keyframes na-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .na-spinner { animation-duration: 2s; } }

.na-glyph { display: flex; justify-content: center; margin-bottom: 14px; color: var(--success); }
.na-glyph svg { width: 34px; height: 34px; }
.na-glyph-warn { color: var(--warning); }

.na-hint { margin-top: 14px; text-align: center; font-size: var(--text-sm); color: var(--text-3); }

.na-actions { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.na-return { margin-top: 20px; text-decoration: none !important; }

/* the sheet is roughly phone-width — keep every tap target at 44 px */
.na-actions .btn, .na-return { min-height: 44px; }
