/* ═══════════════════════════════════════════════════════════════════════════
   DynamicDiningMenus — Auth Pages CSS
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root,
[data-theme="dark"] {
  --brand-primary: #7c3aed;
  --brand-primary-light: #a78bfa;
  --bg-base: #0f0f17;
  --bg-surface: #1a1a2e;
  --bg-surface-2: #1e1e35;
  --border: rgba(255, 255, 255, 0.07);
  --border-light: rgba(255, 255, 255, 0.12);
  --text-primary: #f0f0f8;
  --text-secondary: #a0a0c0;
  --text-muted: #6b6b8a;
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --green: #10b981;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 20px;
}

[data-theme="light"] {
  --brand-primary: #7c3aed;
  --brand-primary-light: #6d28d9;
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --red: #dc2626;
  --red-bg: rgba(220, 38, 38, 0.1);
  --green: #059669;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 20px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ─── Background ─────────────────────────────────────────────────────────── */
.auth-body {
  position: relative;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.22;
  animation: float 8s ease-in-out infinite;
}

.auth-orb-1 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, #7c3aed, transparent);
  top: -120px; left: -120px;
  animation-delay: 0s;
}

.auth-orb-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, #3b82f6, transparent);
  bottom: -80px; right: -80px;
  animation-delay: 3s;
}

.auth-orb-3 {
  width: 220px; height: 220px;
  background: radial-gradient(circle, #f59e0b, transparent);
  top: 40%; left: 60%;
  animation-delay: 5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -25px) scale(1.04); }
  66% { transform: translate(-15px, 18px) scale(0.96); }
}

/* ─── Container ─────────────────────────────────────────────────────────── */
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  z-index: 1;
}

/* ─── Auth Card ─────────────────────────────────────────────────────────── */
.auth-card {
  background: rgba(26, 26, 46, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  width: 100%;
  max-width: 390px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 58, 237, 0.12);
  overflow: hidden;
  animation: cardEntrance 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  margin: auto 0;
}

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.totp-setup-card { max-width: 460px; }

/* ─── Logo / Brand Header ──────────────────────────────────────────────── */
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 24px 14px;
  background: linear-gradient(180deg, rgba(124,58,237,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.auth-logo-icon {
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 10px rgba(124,58,237,0.5));
  flex-shrink: 0;
}

.auth-logo-text {
  display: flex;
  flex-direction: column;
}

.auth-brand {
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, var(--brand-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.auth-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* ─── Form ──────────────────────────────────────────────────────────────── */
.auth-form {
  padding: 18px 24px 20px;
}

.auth-form-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.auth-form-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.user-account-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  margin-bottom: 12px;
}

.badge-avatar {
  font-size: 0.9rem;
  margin-right: 8px;
}

.badge-username {
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--text-primary);
  flex: 1;
}

.badge-switch-btn {
  font-size: 0.72rem;
  color: var(--brand-primary-light);
  text-decoration: none;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.15);
  transition: background 0.15s, color 0.15s;
}

.badge-switch-btn:hover {
  background: rgba(124, 58, 237, 0.35);
  color: #fff;
}

.form-group { margin-bottom: 12px; }

.form-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.2);
}
.form-input::placeholder { color: var(--text-muted); }

.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 40px; }
.toggle-password {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 0.95rem;
  color: var(--text-muted); padding: 4px;
}

/* ─── TOTP input ────────────────────────────────────────────────────────── */
.totp-input {
  letter-spacing: 0.35em;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  padding: 10px 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  background: rgba(15, 15, 23, 0.6);
}

.totp-section {
  background: rgba(124,58,237,0.07);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
}

.form-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; display: block; }

/* ─── Auth error ────────────────────────────────────────────────────────── */
.auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--red-bg);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--red);
  margin-bottom: 12px;
}

/* ─── Button ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 14px rgba(124,58,237,0.3);
}
.btn-primary:hover {
  background: #6d28d9;
  box-shadow: 0 4px 20px rgba(124,58,237,0.5);
  transform: translateY(-1px);
}
.btn-full { width: 100%; }

/* ─── TOTP Setup Steps ──────────────────────────────────────────────────── */
.totp-steps {
  padding: 16px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.totp-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-number {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-content strong { font-size: 0.82rem; display: block; margin-bottom: 1px; }
.step-content p { font-size: 0.75rem; color: var(--text-muted); }

/* ─── QR Code ───────────────────────────────────────────────────────────── */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 22px 10px;
  gap: 12px;
}

.qr-image {
  border: 3px solid white;
  border-radius: 10px;
  background: white;
  width: 170px;
  height: 170px;
}

.secret-reveal { text-align: center; }
.secret-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 4px; }
.secret-key {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.secret-key code { font-family: 'SF Mono', monospace; font-size: 0.75rem; color: var(--brand-primary-light); letter-spacing: 0.08em; word-break: break-all; }
.copy-btn { background: none; border: none; cursor: pointer; font-size: 0.85rem; padding: 2px; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  padding: 10px 16px;
  font-size: 0.7rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-height: 720px) {
  .auth-container { padding: 10px 14px; }
  .auth-logo { padding: 12px 20px 10px; }
  .auth-logo-icon { font-size: 1.7rem; }
  .auth-form { padding: 14px 20px 16px; }
  .auth-form-sub { margin-bottom: 10px; }
  .form-group { margin-bottom: 9px; }
  .totp-section { padding: 8px 10px; margin-bottom: 10px; }
  .auth-footer { padding: 6px; }
}

@media (max-width: 480px) {
  .auth-card { border-radius: var(--radius-sm); }
  .auth-logo { padding: 14px 18px 10px; }
  .auth-form { padding: 16px 18px; }
  .auth-form-title { font-size: 1.05rem; }
  .auth-brand { font-size: 1.15rem; }
}

/* ─── Light Theme Auth Polish ────────────────────────────────────────────── */
[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(124, 58, 237, 0.1);
  border-color: #e2e8f0;
}

[data-theme="light"] .auth-orb-1 {
  opacity: 0.12;
}

[data-theme="light"] .auth-orb-2 {
  opacity: 0.08;
}

[data-theme="light"] .auth-orb-3 {
  opacity: 0.08;
}

[data-theme="light"] .form-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .form-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

[data-theme="light"] .user-account-badge {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

[data-theme="light"] .totp-section {
  background: #f8fafc;
  border-color: #e2e8f0;
}

