/* ══════════════════════════════════════
   Auth Overlay Styles — 比爛
   ══════════════════════════════════════ */

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: var(--overlay-bg);
  animation: authFadeIn 0.2s ease;
}

.auth-overlay.hidden { display: none !important; }

@keyframes authFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Auth Card（置中彈窗，非底部 sheet） ── */
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: 28px 22px 24px;
  max-height: min(88dvh, 640px);
  overflow-y: auto;
  animation: authModalIn 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
  border: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

@keyframes authModalIn {
  from { transform: scale(0.94) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ── Logo ── */
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 24px;
}

.auth-logo-img {
  width: 160px;
  height: auto;
  margin-bottom: 4px;
  mix-blend-mode: screen;
  border-radius: 16px;
}

[data-theme="light"] .auth-logo-img {
  mix-blend-mode: multiply;
}

.auth-logo-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  text-align: center;
}

/* Sign in with Apple（深色介面用白底黑字） */
.btn-apple {
  background: #fff;
  color: #000;
  border: none;
  font-weight: 600;
}

.btn-apple:hover {
  background: #f2f2f2;
}

.btn-apple:disabled {
  opacity: 0.7;
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  border-radius: calc(var(--radius-md) - 3px);
  transition: all 0.15s;
  cursor: pointer;
}

.auth-tab-active {
  background: var(--bg-card);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ── Form Inputs ── */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 15px;
  transition: border-color 0.15s;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-tertiary); }

/* ── Buttons ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  border: none;
  gap: 8px;
  font-family: var(--font-base);
}

.btn:active { opacity: 0.85; transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.btn-block { width: 100%; }

/* ── Terms gate (EULA) ── */
.terms-overlay { z-index: 550; }

.terms-gate-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
}

.terms-gate-lead {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 12px;
}

.terms-gate-links {
  font-size: 13px;
  text-align: center;
  margin-bottom: 16px;
}

.terms-gate-links a { color: var(--accent); font-weight: 600; }

.terms-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 16px;
  cursor: pointer;
}

.terms-check-row input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.terms-gate-error {
  font-size: 13px;
  color: #ef4444;
  margin-bottom: 10px;
  text-align: center;
}

.terms-gate-error.hidden { display: none; }

.terms-decline-btn { margin-top: 10px; }
