/* SwaDharma Live Puja — shared design system.
   Palette from swadharma.online (saffron #F7961D, navy #182856, cream #F7F3EC) + logo terracotta #CF5733. */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/shared/fonts/cormorant-garamond.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/shared/fonts/inter.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --saffron: #F7961D;
  --saffron-soft: #FDE7C8;
  --terracotta: #CF5733;
  --terracotta-deep: #A84030;
  --maroon: #7A1F1F;
  --gold: #D4A017;
  --gold-soft: #F6E3A6;
  --navy: #182856;
  --cream: #FBF6EE;
  --cream-2: #F7F3EC;
  --card: #FFFFFF;
  --ink: #2B1B12;
  --muted: #6E5B4E;
  --line: #EADFCF;
  --green: #17703E;
  --green-soft: #DDF3E5;
  --red: #C0392B;
  --red-soft: #FBE3DF;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(43, 27, 18, .06), 0 8px 28px rgba(122, 31, 31, .08);
  --shadow-lg: 0 2px 6px rgba(43, 27, 18, .08), 0 18px 50px rgba(122, 31, 31, .16);
  --grad: linear-gradient(135deg, #F7961D 0%, #CF5733 100%);
  --grad-gold: linear-gradient(135deg, #F6E3A6 0%, #F7961D 100%);
  --serif: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--terracotta-deep); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .4em; color: var(--maroon); letter-spacing: .01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

:focus-visible { outline: 3px solid rgba(247, 150, 29, .55); outline-offset: 2px; border-radius: 8px; }

/* Mandala motif: pure SVG, used as a soft decorative background. */
.mandala-bg {
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(247, 150, 29, .16), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%23D4A017' stroke-opacity='.13' stroke-width='1'%3E%3Ccircle cx='110' cy='110' r='36'/%3E%3Ccircle cx='110' cy='110' r='58'/%3E%3Cpath d='M110 52c14 18 14 40 0 58-14-18-14-40 0-58zM110 168c-14-18-14-40 0-58 14 18 14 40 0 58zM52 110c18-14 40-14 58 0-18 14-40 14-58 0zM168 110c-18 14-40 14-58 0 18-14 40-14 58 0z'/%3E%3Cpath d='M69 69c22 2 38 18 41 41-22-3-39-19-41-41zM151 151c-22-2-38-18-41-41 22 3 39 19 41 41zM151 69c-2 22-18 38-41 41 3-22 19-39 41-41zM69 151c2-22 18-38 41-41-3 22-19 39-41 41z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, repeat;
  background-size: 100% 560px, 220px 220px;
}

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: calc(10px + var(--safe-top)) clamp(14px, 3vw, 28px) 10px;
  background: rgba(251, 246, 238, .88);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand img { height: 44px; width: auto; }
@media (max-width: 420px) { .brand img { height: 36px; } .site-label { font-size: .95rem; padding: 2px 10px; } }
.site-label {
  font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--maroon);
  padding: 3px 12px; border-radius: 999px; background: var(--saffron-soft); border: 1px solid #F5D3A5; white-space: nowrap;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-footer {
  margin-top: auto; /* sticky footer: content that renders late doesn't push it around (CLS) */
  text-align: center; padding: 28px 16px calc(28px + var(--safe-bottom));
  color: var(--muted); font-size: .85rem;
}
.site-footer .tagline { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--terracotta-deep); display: block; margin-bottom: 2px; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--card); --fg: var(--ink); --bd: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: .95rem; line-height: 1.1; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  -webkit-tap-highlight-color: transparent; user-select: none; white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-primary { --bg: var(--grad); --fg: #fff; --bd: transparent; background: var(--grad); box-shadow: 0 6px 18px rgba(207, 87, 51, .28); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(207, 87, 51, .36); }
.btn-navy { --bg: var(--navy); --fg: #fff; --bd: var(--navy); }
.btn-ghost { --bg: transparent; --bd: transparent; }
.btn-ghost:hover { --bg: rgba(247, 150, 29, .1); box-shadow: none; }
.btn-danger { --bg: var(--red); --fg: #fff; --bd: var(--red); }
.btn-success { --bg: var(--green); --fg: #fff; --bd: var(--green); }
.btn-whatsapp { --bg: #25D366; --fg: #08361A; --bd: #25D366; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; }
.btn-icon { width: 44px; padding: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- cards / forms ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(18px, 3vw, 28px); }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title h2 { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field .hint { font-size: .8rem; color: var(--muted); }
.field .err { font-size: .82rem; color: var(--red); min-height: 0; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid #DCCDB8; background: #FFFDF9; transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 4px rgba(247, 150, 29, .18); }
.input[aria-invalid="true"] { border-color: var(--red); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236E5B4E' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

/* ---------- badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge-scheduled { background: #EEF1F8; color: var(--navy); }
.badge-live { background: var(--red-soft); color: var(--red); }
.badge-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.4s ease-in-out infinite; }
.badge-completed { background: var(--green-soft); color: var(--green); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #CFC4B5; flex: none; }
.dot.on { background: #22B35E; box-shadow: 0 0 0 4px rgba(34, 179, 94, .18); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-radius: 14px; background: var(--ink); color: #FFF8EE; box-shadow: var(--shadow-lg); font-size: .92rem; animation: toast-in .25s ease; }
.toast .btn { min-height: 34px; padding: 6px 14px; margin-left: auto; --bg: var(--saffron); --fg: #2B1B12; --bd: var(--saffron); }
.toast.error { background: #7A1F1F; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- login ---------- */
.login-wrap { min-height: calc(100dvh - 140px); display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(420px, 100%); text-align: center; }
.login-card .emblem { width: 92px; margin: 0 auto 10px; }
.pin-input { text-align: center; font-size: 1.6rem; letter-spacing: .5em; font-weight: 700; padding-left: calc(14px + .5em); }

/* ---------- misc ---------- */
.divider-om { display: flex; align-items: center; gap: 12px; color: var(--gold); font-family: var(--serif); }
.divider-om::before, .divider-om::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); }
.ios-hint { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--muted); background: #FFF; border: 1px dashed #E7C995; border-radius: 12px; padding: 10px 12px; }
.ios-hint svg { width: 20px; height: 20px; color: var(--navy); flex: none; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(207, 87, 51, .2); border-top-color: var(--terracotta); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
