/* KARMA — Core styles. Mobile-first premium app shell. */

:root {
  /* Light theme (default) */
  --bg: #FFFBEB;
  --bg-elev: #FFFFFF;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-solid: #FFFFFF;
  --border: rgba(245, 158, 11, 0.22);
  --border-soft: rgba(30, 41, 59, 0.08);
  --text: #1E293B;
  --text-muted: #64748B;
  --text-faint: #94A3B8;
  --primary: #D97706;
  --primary-hover: #B45309;
  --primary-soft: rgba(217, 119, 6, 0.10);
  --accent-teal: #0F766E;
  --accent-pink: #BE185D;
  --accent-indigo: #4338CA;
  --success: #059669;
  --danger: #DC2626;
  --shadow-sm: 0 2px 8px rgba(217, 119, 6, 0.08);
  --shadow-md: 0 8px 24px rgba(30, 41, 59, 0.10);
  --shadow-lg: 0 20px 60px rgba(30, 41, 59, 0.15);
  --shadow-glow: 0 8px 40px rgba(245, 158, 11, 0.35);

  --grad-primary: linear-gradient(135deg, #F59E0B 0%, #FBBF24 50%, #D97706 100%);
  --grad-krishna: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #6D28D9 100%);
  --grad-dawn: linear-gradient(180deg, #FFFBEB 0%, #FED7AA 50%, #FDBA74 100%);

  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --app-max: 480px;
  --nav-h: 72px;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #020617;
  --bg-elev: #0F172A;
  --surface: rgba(15, 23, 42, 0.65);
  --surface-solid: #0F172A;
  --border: rgba(245, 158, 11, 0.18);
  --border-soft: rgba(248, 250, 252, 0.06);
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --text-faint: #64748B;
  --primary: #F59E0B;
  --primary-hover: #FBBF24;
  --primary-soft: rgba(245, 158, 11, 0.14);
  --accent-teal: #14B8A6;
  --accent-pink: #F472B6;
  --accent-indigo: #818CF8;
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 8px 40px rgba(245, 158, 11, 0.28);
  --grad-dawn: linear-gradient(180deg, #020617 0%, #0F172A 50%, #1E1B4B 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--grad-dawn);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.55;
  transition: background 0.6s ease, color 0.3s ease;
}

/* App shell — mobile-app feel */
.app-shell {
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-top: calc(var(--header-h) + env(safe-area-inset-top));
}

/* Decorative background orbs */
.bg-decor {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.35;
  animation: orbFloat 18s ease-in-out infinite;
}
.bg-orb-1 { width: 320px; height: 320px; background: #F59E0B; top: -80px; left: -80px; }
.bg-orb-2 { width: 260px; height: 260px; background: #0F766E; bottom: -60px; right: -60px; animation-delay: -6s; opacity: 0.22; }
.bg-orb-3 { width: 220px; height: 220px; background: #6D28D9; top: 40%; right: -100px; animation-delay: -12s; opacity: 0.18; }
[data-theme="dark"] .bg-orb { opacity: 0.28; }
[data-theme="dark"] .bg-orb-1 { opacity: 0.22; }

/* Header */
.top-header {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-max);
  height: var(--header-h);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 30;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 22px;
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  flex-shrink: 0;
}
.brand-mark.logo-mark {
  background: transparent;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.35), 0 4px 14px rgba(245, 158, 11, 0.35);
  padding: 0;
  border: 3px solid rgba(255, 215, 0, 0.6);
  border-radius: 50%;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.brand-mark.logo-mark img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
/* Prominent logo (modal / login card) — spec size 80x80 with golden ring */
.brand-mark.modal-mark.logo-mark {
  width: 80px; height: 80px; margin: 0 auto 12px;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.45), 0 8px 24px rgba(245, 158, 11, 0.35);
}
@media (max-width: 480px) {
  .brand-mark.modal-mark.logo-mark { width: 64px; height: 64px; }
}
/* Responsive header logo sizing (per spec: 80/70/60) — kept smaller in the compact mobile header */
@media (min-width: 1024px) {
  .top-header .brand-mark.logo-mark { width: 52px; height: 52px; }
}
.brand-name {
  font-family: var(--font-heading);
  font-weight: 700; font-size: 22px; letter-spacing: 0.5px;
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border-soft);
  background: var(--surface); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  cursor: pointer; transition: all 0.25s ease;
}
.icon-btn:hover { color: var(--primary); border-color: var(--border); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }

.avatar-mini {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 600; font-size: 14px;
  cursor: pointer; border: 2px solid var(--border);
}

/* Main content */
.app-main { position: relative; z-index: 1; padding: 20px 18px 32px; }
.view { animation: viewFadeIn 0.45s ease; }
.hidden { display: none !important; }

/* Glass panel */
.glass {
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* ============ HOME ============ */
.hero { text-align: center; padding: 8px 0 32px; position: relative; }
.hero-glow {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.35), transparent 70%);
  filter: blur(30px);
  z-index: -1;
  animation: pulse 6s ease-in-out infinite;
}
.hero-img {
  width: 220px; height: 220px; border-radius: 50%;
  object-fit: cover; object-position: center top;
  border: 4px solid rgba(255,255,255,0.4);
  box-shadow: var(--shadow-glow), 0 0 0 8px rgba(245, 158, 11, 0.1);
  margin: 8px auto 20px;
  display: block;
  animation: floaty 5s ease-in-out infinite;
  background: var(--surface);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: 40px; font-weight: 700; line-height: 1.05; letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 14px;
}
.hero-title .grad-text {
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-style: italic;
}
.hero-sub {
  font-size: 15px; color: var(--text-muted);
  max-width: 340px; margin: 0 auto 24px; line-height: 1.6;
}

/* Buttons */
.btn-primary {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 24px; border-radius: 100px; border: none;
  background: var(--grad-primary); color: white;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  letter-spacing: 0.3px;
  cursor: pointer; transition: all 0.28s ease;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(245, 158, 11, 0.5); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary.btn-lg { padding: 16px 28px; font-size: 16px; max-width: 320px; }
.btn-primary i { font-size: 20px; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-premium {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 100px; border: none;
  background: linear-gradient(135deg, #FDE68A 0%, #F59E0B 50%, #D97706 100%);
  color: #431407; font-weight: 700; font-size: 15px;
  cursor: pointer; transition: all 0.28s ease;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.55), inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn-premium:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(245, 158, 11, 0.65); }
.btn-premium:active { transform: scale(0.97); }

.btn-ghost {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 100px;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border-soft);
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  cursor: pointer; transition: all 0.25s ease;
  margin-top: 10px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--border); background: var(--primary-soft); }
.btn-ghost.btn-danger { color: var(--danger); }
.btn-ghost.btn-danger:hover { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.3); }

.btn-google {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; border-radius: 100px;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border-soft);
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  cursor: pointer; transition: all 0.25s ease;
}
.btn-google:hover { border-color: var(--border); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* Section title */
.section-title-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 12px 4px 14px;
}
.section-title {
  font-family: var(--font-heading);
  font-size: 26px; font-weight: 600; letter-spacing: -0.3px;
  color: var(--text);
}

/* Feature grid */
.feature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-bottom: 24px;
}
.feature-card {
  padding: 18px 16px;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  cursor: default;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feat-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 12px;
}
.feat-icon-amber { background: rgba(245, 158, 11, 0.15); color: #D97706; }
.feat-icon-teal { background: rgba(15, 118, 110, 0.15); color: var(--accent-teal); }
.feat-icon-pink { background: rgba(190, 24, 93, 0.15); color: var(--accent-pink); }
.feat-icon-indigo { background: rgba(67, 56, 202, 0.15); color: var(--accent-indigo); }
.feat-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.feat-sub { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

/* Premium card */
.premium-card {
  position: relative; margin: 22px 0;
  border-radius: var(--radius-lg);
  padding: 2px;
  background: linear-gradient(135deg, #FDE68A, #F59E0B, #D97706, #F59E0B, #FDE68A);
  background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
  box-shadow: 0 20px 50px rgba(245, 158, 11, 0.25);
}
.premium-inner {
  background: var(--bg-elev);
  border-radius: calc(var(--radius-lg) - 2px);
  padding: 24px 20px;
}
[data-theme="dark"] .premium-inner { background: #1E293B; }
.premium-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 100px;
  background: linear-gradient(135deg, #FDE68A, #F59E0B);
  color: #451A03; font-weight: 700; font-size: 12px;
  margin-bottom: 12px;
}
.premium-title {
  font-family: var(--font-heading);
  font-size: 24px; font-weight: 700; margin-bottom: 14px;
  color: var(--text);
}
.premium-list { list-style: none; margin-bottom: 18px; }
.premium-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 14px; color: var(--text);
}
.premium-list li i { color: var(--primary); font-size: 18px; }
.premium-list.center { text-align: left; max-width: 300px; margin: 16px auto; }

/* Quote card */
.quote-card {
  padding: 24px 22px;
  border-radius: var(--radius-lg);
  margin: 20px 0;
  position: relative;
  text-align: center;
}
.quote-mark {
  font-family: var(--font-heading);
  font-size: 60px; line-height: 0.5;
  color: var(--primary); opacity: 0.5;
  margin-bottom: 4px;
}
.quote-text {
  font-family: var(--font-heading);
  font-size: 20px; font-style: italic; font-weight: 500;
  color: var(--text); line-height: 1.4;
  margin-bottom: 10px;
}
.quote-attr { font-size: 12px; color: var(--text-muted); letter-spacing: 1px; text-transform: uppercase; }

/* Footer */
.app-footer {
  text-align: center; padding: 30px 0 12px;
  border-top: 1px solid var(--border-soft);
  margin-top: 20px;
}
.footer-brand {
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.footer-brand .footer-logo {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 215, 0, 0.6);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.35);
}
.footer-brand i { color: var(--primary); background: none; -webkit-text-fill-color: initial; }
.footer-line { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.footer-fine { font-size: 11px; color: var(--text-faint); }

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-max);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; justify-content: space-around; align-items: center;
  z-index: 40;
  border-radius: 24px 24px 0 0;
  border-bottom: none;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px; background: transparent; border: none;
  color: var(--text-muted); font-size: 10px; font-weight: 500; letter-spacing: 0.3px;
  cursor: pointer; transition: all 0.28s ease; font-family: var(--font-body);
  position: relative;
}
.nav-item i { font-size: 24px; transition: transform 0.28s ease; }
.nav-item.active { color: var(--primary); }
.nav-item.active i { transform: scale(1.12); }
.nav-item.active::before {
  content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 3px; background: var(--grad-primary);
}
.nav-item:hover:not(.active) { color: var(--text); }
.nav-item:active { transform: scale(0.94); }
