/* ── AOM PWA Stylesheet ─────────────────────────────────────────────── */

:root {
  --bg:         #ffffff;
  --surface:    #f7f7f9;
  --border:     #e8e8ed;
  --navy:       #1e2d5a;
  --navy-light: #2e4080;
  --gold:       #c9922a;
  --text:       #1e2d5a;
  --muted:      #8a90a2;
  --error:      #c0392b;
  --success:    #2e7d5e;
  --radius:     14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

/* ── Logo ───────────────────────────────────────────────────────────── */

.logo-img {
  width: 180px;
  height: auto;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

.logo-img-small {
  height: 32px;
  width: auto;
}

/* ── Install wall ───────────────────────────────────────────────────── */

#install-prompt {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 32px;
  text-align: center;
}

.install-logo {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

.install-logo-a,
.install-logo-m {
  font-family: 'Playfair Display', serif;
  font-size: 54px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
}

.install-logo-gem { font-size: 34px; color: var(--gold); margin: 0 3px; line-height: 1; }

.install-tagline {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.7s 0.1s ease forwards;
}

.install-card {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  opacity: 0;
  animation: fadeUp 0.7s 0.2s ease forwards;
}

.install-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 8px;
}

.install-card-sub {
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 24px;
}

#android-install-btn {
  display: none;
  width: 100%;
  padding: 15px;
  background: var(--navy);
  border: none;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

#android-install-btn:hover { background: var(--navy-light); }

#ios-install-steps { display: none; text-align: left; }

.install-steps {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  counter-reset: steps;
}

.install-steps li {
  counter-increment: steps;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  font-weight: 300;
  color: var(--text);
  line-height: 1.5;
}

.install-steps li::before {
  content: counter(steps);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  margin-top: 1px;
}

.install-steps strong { color: var(--navy); font-weight: 500; }

.install-share-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--gold);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
  margin: 0 2px;
}

#desktop-install-msg { display: none; }

.install-url {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--navy);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.05em;
}

.install-arrow {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── Auth ───────────────────────────────────────────────────────────── */

#auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px 32px;
}

.auth-logo {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}

.auth-logo-a,
.auth-logo-m {
  font-family: 'Playfair Display', serif;
  font-size: 54px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
}

.auth-logo-mandala { font-size: 34px; color: var(--gold); margin: 0 3px; line-height: 1; }

.auth-tagline {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.7s 0.1s ease forwards;
}

.auth-form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  animation: fadeUp 0.7s 0.2s ease forwards;
}

.field input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 18px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.field input::placeholder { color: var(--muted); }
.field input:focus { border-color: var(--navy); }

.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--navy);
  border: none;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}

.btn-primary:hover { background: var(--navy-light); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.auth-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 20px;
  line-height: 1.7;
  opacity: 0;
  animation: fadeUp 0.7s 0.3s ease forwards;
}

#auth-error {
  font-size: 12px;
  color: var(--error);
  text-align: center;
  min-height: 16px;
}

#magic-sent {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

#magic-sent .sent-icon { font-size: 44px; margin-bottom: 4px; }

#magic-sent h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--navy);
}

#magic-sent p { font-size: 13px; color: var(--muted); line-height: 1.65; max-width: 260px; }

/* ── Main app ───────────────────────────────────────────────────────── */

#main-app { display: none; flex-direction: column; flex: 1; overflow: hidden; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px 11px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.app-logo { display: flex; align-items: center; }

.app-logo-letter {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--navy);
}

.app-logo-gem { color: var(--gold); font-size: 16px; margin: 0 2px; }

.logout-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.logout-btn:hover { color: var(--navy); }

/* ── Panels ─────────────────────────────────────────────────────────── */

.tab-content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.tab-panel { display: none; padding: 24px 20px 36px; animation: fadeIn 0.2s ease; }
.tab-panel.active { display: block; }

.panel-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 22px;
}

/* ── Video ──────────────────────────────────────────────────────────── */

.video-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

.video-meta { margin-top: 16px; }

.video-day {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.video-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--navy);
}

/* ── Horary ─────────────────────────────────────────────────────────── */

.horary-form { display: flex; flex-direction: column; gap: 16px; }

.form-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
  display: block;
}

.form-group { display: flex; flex-direction: column; }

textarea {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  resize: none;
  outline: none;
  line-height: 1.6;
  transition: border-color 0.2s;
}

textarea::placeholder { color: var(--muted); }
textarea:focus { border-color: var(--navy); }

.location-row { display: flex; gap: 10px; align-items: flex-end; }
.location-row .form-group { flex: 1; }

.location-row input {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

.location-row input:focus { border-color: var(--navy); }

.btn-locate {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--navy);
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
  transition: border-color 0.2s;
}

.btn-locate:hover { border-color: var(--navy); }

.questions-remaining {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fdf8f0;
  border: 1px solid #eed9a0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 400;
  color: var(--gold);
}

.questions-remaining span { font-weight: 600; color: var(--navy); }

#horary-result {
  margin-top: 4px;
  padding: 16px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  display: none;
}

#horary-result.visible { display: block; animation: fadeIn 0.3s ease; }
#horary-result.error { border-color: #f5c6c2; background: #fdf4f3; color: var(--error); }

.result-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

/* ── Swara ──────────────────────────────────────────────────────────── */

.swara-today {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  margin-bottom: 14px;
}

.swara-expected-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
}

.swara-nostril {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 400;
  color: #fff;
  margin-bottom: 4px;
}

.swara-nostril.left  { color: #9ecce8; }
.swara-nostril.right { color: #f0c56a; }

.swara-nostril-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.swara-alignment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.swara-alignment-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.swara-alignment-score {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--navy);
}

.swara-alignment-score span { color: var(--gold); }
.swara-alignment-pct { font-size: 12px; font-weight: 300; color: var(--muted); margin-top: 2px; }
.swara-ring { width: 54px; height: 54px; flex-shrink: 0; }

.swara-record { margin-bottom: 18px; }

.swara-record-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.swara-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.swara-btn {
  padding: 14px 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.swara-btn .swara-btn-icon { font-size: 20px; }
.swara-btn:hover { border-color: var(--navy); color: var(--navy); }
.swara-btn.selected-left  { border-color: #5aaacf; color: #3a8cb0; background: #f0f8fd; }
.swara-btn.selected-right { border-color: #d4933a; color: #b07020; background: #fdf6ed; }
.swara-btn.selected-both  { border-color: var(--navy); color: var(--navy); background: #f0f2f8; }

.swara-recorded {
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--success);
  display: none;
  letter-spacing: 0.04em;
}

.swara-about {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.85;
  border-left: 3px solid #e8d4a0;
  padding-left: 16px;
}

/* ── Pack ───────────────────────────────────────────────────────────── */

.pack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.pack-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--navy);
  margin-bottom: 8px;
}

.pack-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.pack-price {
  font-family: 'Playfair Display', serif;
  font-size: 38px;
  font-weight: 400;
  color: var(--gold);
  margin-bottom: 20px;
}

.pack-price sup { font-size: 16px; vertical-align: super; }

.pack-includes { display: flex; flex-direction: column; gap: 9px; margin-bottom: 24px; }

.pack-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 300;
  color: var(--text);
}

.pack-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.btn-buy {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--navy);
  border: none;
  border-radius: var(--radius);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-buy:hover { background: var(--navy-light); }

/* ── Bottom nav ─────────────────────────────────────────────────────── */

.bottom-nav {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-btn.active { color: var(--navy); }

.nav-icon { font-size: 18px; line-height: 1; }

.nav-label {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 1px;
  opacity: 0;
  transition: opacity 0.2s;
}

.nav-btn.active .nav-dot { opacity: 1; }

/* ── Animations ─────────────────────────────────────────────────────── */

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

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

/* ── Spinner ─────────────────────────────────────────────────────────── */

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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