/* ============================================================
   style.css — RideGuard Design System
   Mobile-First, Safety-Focused UI
   ============================================================ */

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

/* ─── CSS VARIABLES ──────────────────────────────────────── */
:root {
  --navy:       #002D62;
  --blue:       #004080;
  --blue-mid:   #005380;
  --blue-dark:  #001F4C;
  --blue-light: #E8F0FA;
  --blue-glow:  rgba(0, 83, 128, 0.3);

  --safe:       #22C55E;
  --safe-bg:    #F0FDF4;
  --warn:       #F59E0B;
  --warn-bg:    #FFFBEB;
  --danger:     #EF4444;
  --danger-bg:  #FEF2F2;

  --white:      #FFFFFF;
  --gray-50:    #F8FAFC;
  --gray-100:   #F1F5F9;
  --gray-200:   #E2E8F0;
  --gray-400:   #94A3B8;
  --gray-600:   #475569;
  --gray-800:   #1E293B;

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-sm:  0 2px 8px rgba(0, 45, 98, 0.08);
  --shadow-md:  0 4px 20px rgba(0, 45, 98, 0.12);
  --shadow-lg:  0 8px 40px rgba(0, 45, 98, 0.18);
  --shadow-xl:  0 20px 60px rgba(0, 45, 98, 0.25);

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);

  --font-body:  'Sora', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;

  --nav-height: 64px;
  --max-width:  480px;
}

/* ─── RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--blue-mid); border-radius: 4px; }

/* ─── NAVIGATION ─────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.navbar-logo {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--blue-mid), var(--blue-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.navbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
}

.navbar-title span {
  color: #60A5FA;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-status {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gray-400);
  transition: background var(--transition);
}
.navbar-status.connected { background: var(--safe); box-shadow: 0 0 0 3px rgba(34,197,94,0.25); }
.navbar-status.alert     { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,0.3); animation: pulse-red 1s infinite; }

.btn-icon {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 10px;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.btn-icon:hover { background: rgba(255,255,255,0.2); }

/* ─── PAGE WRAPPER ───────────────────────────────────────── */
.page {
  display: none;
  min-height: 100vh;
  padding-top: var(--nav-height);
}
.page.active { display: block; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px 100px;
}

/* ─── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  border: 1px solid var(--gray-100);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:active { transform: scale(0.99); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
}

.card-icon {
  width: 36px; height: 36px;
  background: var(--blue-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ─── STATUS CARD ────────────────────────────────────────── */
.status-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: var(--white);
  border: none;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

.status-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.status-card::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -20px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}

.status-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 6px;
}

.status-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.status-sub {
  font-size: 0.85rem;
  opacity: 0.65;
  margin-bottom: 20px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.status-badge.safe    { background: rgba(34,197,94,0.2);  color: #86EFAC; border: 1px solid rgba(34,197,94,0.3); }
.status-badge.warning { background: rgba(245,158,11,0.2); color: #FCD34D; border: 1px solid rgba(245,158,11,0.3); }
.status-badge.danger  { background: rgba(239,68,68,0.2);  color: #FCA5A5; border: 1px solid rgba(239,68,68,0.3); animation: pulse-badge 1.2s ease-in-out infinite; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; }
.status-dot.safe    { background: var(--safe); }
.status-dot.warning { background: var(--warn); }
.status-dot.danger  { background: var(--danger); animation: blink 0.8s step-end infinite; }

.status-time {
  margin-top: 16px;
  font-size: 0.75rem;
  opacity: 0.5;
  font-family: var(--font-mono);
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
  letter-spacing: -0.01em;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 100%);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0, 64, 128, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(0, 64, 128, 0.45); transform: translateY(-1px); }

.btn-navy {
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-outline:hover { background: var(--blue-light); }

.btn-danger {
  background: linear-gradient(135deg, #DC2626, var(--danger));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.btn-safe {
  background: linear-gradient(135deg, #16A34A, var(--safe));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.35);
}

.btn-sm {
  width: auto;
  padding: 10px 18px;
  font-size: 0.85rem;
}

.btn-ghost {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ─── BLUETOOTH CONNECT BUTTON ───────────────────────────── */
.ble-btn {
  width: 100%;
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--blue-mid);
  background: var(--blue-light);
  color: var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.ble-btn:hover { border-style: solid; background: #D4E5F7; }
.ble-btn.connected {
  border-color: var(--safe);
  background: var(--safe-bg);
  color: #16A34A;
  border-style: solid;
}
.ble-btn-icon { font-size: 2rem; }
.ble-btn-label { font-size: 0.95rem; font-weight: 600; }
.ble-btn-sub { font-size: 0.78rem; opacity: 0.7; }

/* ─── FORMS ──────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(0, 83, 128, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--gray-400); }

.form-textarea { resize: vertical; min-height: 90px; }

/* ─── CONTACT TAGS ───────────────────────────────────────── */
.contacts-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.contact-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 500;
}

.contact-tag button {
  background: none;
  border: none;
  color: var(--blue-mid);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  line-height: 1;
  padding: 0;
}

.contact-input-row {
  display: flex;
  gap: 8px;
}
.contact-input-row .form-input { flex: 1; }
.contact-input-row .btn-sm { flex-shrink: 0; }

/* ─── AUTH PAGE ──────────────────────────────────────────── */
#page-auth {
  background: linear-gradient(160deg, var(--navy) 0%, var(--blue) 60%, var(--blue-mid) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding-top: 0;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 24px 20px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 72px; height: 72px;
  background: rgba(255,255,255,0.1);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 16px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
}

.auth-logo-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.04em;
}

.auth-logo-title span { color: #60A5FA; }

.auth-logo-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-xl);
}

.auth-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.auth-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.auth-error.show { display: block; }

/* ─── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 68px;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  z-index: 99;
  box-shadow: 0 -4px 20px rgba(0, 45, 98, 0.08);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gray-400);
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  border-radius: var(--radius-sm);
}

.bottom-nav-item .nav-icon {
  font-size: 1.4rem;
  transition: transform var(--transition-fast);
}
.bottom-nav-item.active .nav-icon { transform: translateY(-2px); }
.bottom-nav-item.active { color: var(--blue); }

/* ─── FALL DETECTION OVERLAY ─────────────────────────────── */
.fall-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 50, 0.97);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: overlayIn 0.3s ease;
}
.fall-overlay.show { display: flex; }

.fall-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px 28px 32px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 60px rgba(239, 68, 68, 0.3);
  animation: cardBounceIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fall-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: shake 0.6s ease-in-out infinite;
}

.fall-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--danger);
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.fall-sub {
  font-size: 0.95rem;
  color: var(--gray-600);
  margin-bottom: 28px;
}

.fall-timer {
  width: 90px; height: 90px;
  border-radius: 50%;
  background: var(--danger-bg);
  border: 4px solid var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--danger);
  margin: 0 auto 28px;
  font-family: var(--font-mono);
  position: relative;
  transition: border-color 0.3s;
}

.fall-timer-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--danger);
  animation: spin 1s linear infinite;
}

.fall-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── EMERGENCY BANNER ───────────────────────────────────── */
.emergency-banner {
  position: fixed;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--danger);
  color: var(--white);
  padding: 14px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 98;
  animation: slideDown 0.3s ease;
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
}
.emergency-banner.show { display: flex; }

.emergency-banner-text {
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.emergency-banner-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  width: 28px; height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ─── ALERT HISTORY ──────────────────────────────────────── */
.alert-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}
.alert-item:last-child { border-bottom: none; }

.alert-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.alert-icon.confirmed { background: var(--danger-bg); }
.alert-icon.cancelled { background: var(--safe-bg); }

.alert-info { flex: 1; }
.alert-status {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gray-800);
}
.alert-time {
  font-size: 0.75rem;
  color: var(--gray-400);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* ─── FAMILY PORTAL ──────────────────────────────────────── */
.rider-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  border: 1.5px solid var(--gray-100);
  transition: border-color var(--transition);
}
.rider-card.danger { border-color: rgba(239, 68, 68, 0.3); background: #FFF8F8; }

.rider-avatar {
  width: 50px; height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), var(--blue-mid));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.rider-info { flex: 1; }
.rider-name { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.rider-status-text { font-size: 0.8rem; color: var(--gray-400); margin-top: 3px; }

.rider-status-badge {
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
}
.rider-status-badge.safe    { background: var(--safe-bg); color: #16A34A; }
.rider-status-badge.danger  { background: var(--danger-bg); color: #DC2626; animation: pulse-badge 1.2s ease-in-out infinite; }
.rider-status-badge.unknown { background: var(--gray-100); color: var(--gray-400); }

/* ─── TOAST NOTIFICATIONS ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 440px;
  pointer-events: none;
}

.toast {
  background: var(--gray-800);
  color: var(--white);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
}
.toast.success { background: #15803D; }
.toast.error   { background: #DC2626; }
.toast.warning { background: #B45309; }
.toast.fading  { animation: toastOut 0.3s ease forwards; }

/* ─── LOADING ─────────────────────────────────────────────── */
.loader {
  width: 36px; height: 36px;
  border: 3px solid var(--blue-light);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 32px auto;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 45, 98, 0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  color: var(--white);
  font-weight: 600;
  display: none;
}
.loading-overlay.show { display: flex; }

/* ─── SECTION HEADERS ────────────────────────────────────── */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.section-sub {
  font-size: 0.85rem;
  color: var(--gray-400);
  margin-bottom: 20px;
}

/* ─── DIVIDERS & UTILITIES ───────────────────────────────── */
.divider {
  height: 1px;
  background: var(--gray-100);
  margin: 16px 0;
}

.text-center { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8  { margin-bottom: 8px; }

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.badge-blue { background: var(--blue-light); color: var(--blue); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-400);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.empty-state-text { font-size: 0.9rem; }

/* ─── TOGGLE SWITCH ──────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-label { font-size: 0.9rem; font-weight: 500; color: var(--gray-800); }
.toggle-sub { font-size: 0.78rem; color: var(--gray-400); margin-top: 2px; }

.toggle {
  width: 50px; height: 28px;
  background: var(--gray-200);
  border-radius: 100px;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.toggle.on { background: var(--blue-mid); }
.toggle.on::after { transform: translateX(22px); }

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes pulse-red {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.03); }
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-8deg); }
  40% { transform: rotate(8deg); }
  60% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
}

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

@keyframes cardBounceIn {
  from { opacity: 0; transform: scale(0.8) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes toastIn {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(20px); opacity: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.4s ease both;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (min-width: 480px) {
  :root { --max-width: 480px; }
  .container { padding: 24px 20px 100px; }
}

@media (min-width: 768px) {
  :root { --max-width: 520px; }
  .navbar { padding: 0 32px; }
  .auth-container { padding: 40px 24px; }
}

/* ─── LOGO IMAGE STYLES ──────────────────────────────────── */

/* Auth page — large logo above login card */
.auth-logo-img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 28px;
  margin: 0 auto 20px;
  display: block;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  border: 3px solid rgba(255, 255, 255, 0.15);
  animation: logoPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes logoPop {
  from { opacity: 0; transform: scale(0.75); }
  to   { opacity: 1; transform: scale(1); }
}

/* Navbar — small logo next to brand name */
.navbar-logo-img {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
}

/* Loading overlay — centered logo above spinner */
.loading-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 20px;
  display: block;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: logoPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Remove old emoji navbar-logo box sizing since we now use img */
.navbar-logo {
  background: none;
  border-radius: 0;
  padding: 0;
}
