/* ===== App UI (not the biodata page — see templates.css) ===== */
:root {
  color-scheme: light;
  --primary: #8b1e3f; --accent: #d4a017;
  --bg: #faf6f1; --card: #fff; --text: #2b2024; --muted: #74666b; --line: #e8ddd6;
  --radius: 14px; --shadow: 0 6px 24px rgba(60, 20, 30, .08);
}
* { box-sizing: border-box; }
button, input, select, textarea { color: var(--text); }
html, body { margin: 0; }
body {
  font-family: "Poppins", "Noto Sans Devanagari", "Noto Sans Gurmukhi", "Noto Sans Gujarati", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh;
  display: flex; flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 16px; }
a { color: var(--primary); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--primary); text-decoration: none; }
.brand-logo img { height: 34px; display: block; }
.brand-logo { font-size: 1.5rem; }
.lang-switch select, select, input, textarea {
  font: inherit; color: inherit; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
.lang-switch select { width: auto; padding: 6px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }

/* Hero / language */
.hero { text-align: center; padding: 48px 8px 24px; }
.hero h1 { font-family: "Playfair Display", "Tiro Devanagari Hindi", "Noto Sans Gurmukhi", serif; font-size: clamp(1.8rem, 5vw, 2.8rem); margin: 0 0 8px; color: var(--primary); }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; }
.lang-heading { margin: 40px 0 16px; font-size: 1.1rem; }
.lang-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 760px; margin: 0 auto; }
@media (max-width: 640px) { .lang-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } .lang-card { padding: 20px 8px; } }
.lang-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 26px 12px;
  font: inherit; font-size: 1.25rem; font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
  color: var(--text);
  transition: transform .15s, border-color .15s;
}
.lang-card:hover, .lang-card:focus-visible { transform: translateY(-2px); border-color: var(--primary); color: var(--primary); }
.privacy-note { margin-top: 28px !important; font-size: .85rem; }

/* Stepper */
.stepper { list-style: none; display: flex; gap: 8px; padding: 0; margin: 8px 0 18px; overflow-x: auto; }
.stepper li {
  flex: 1; min-width: 120px; display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.stepper .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 600; font-size: .8rem; flex: none; }
.stepper li.active { border-color: var(--primary); color: var(--primary); font-weight: 600; }
.stepper li.active .num, .stepper li.done .num { background: var(--primary); color: #fff; }

/* Layout */
.wiz-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.wiz-right { position: sticky; top: 76px; }
.preview-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.preview-frame { position: relative; width: 100%; aspect-ratio: 794 / 1123; overflow: hidden; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.15); background: #fff; }
.preview-scale { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; transform-origin: 0 0; }
.watermark {
  position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden;
  display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around;
}
.watermark span { transform: rotate(-30deg); font-weight: 700; font-size: 22px; color: rgba(0,0,0,.09); padding: 18px 10px; user-select: none; }

@media (max-width: 900px) {
  .wiz-grid { grid-template-columns: 1fr; }
  .wiz-right { position: static; max-width: 440px; margin: 0 auto; width: 100%; }
}

/* Form */
.step { display: none; }
.step.active { display: block; }
.step h3 { margin: 0 0 14px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; }
.form-section { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.form-section > h3 { margin: 0 0 12px; font-size: 1.05rem; color: var(--primary); }
.form-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); column-gap: 14px; }
.form-cols .field.wide { grid-column: 1 / -1; }
.custom-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: .82rem; margin: 4px 0; }
.strong { font-weight: 600; margin: 0 0 2px; }

.symbol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.symbol-btn {
  height: 58px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  font-family: "Noto Sans Devanagari", "Noto Sans Gurmukhi", "Noto Sans Symbols", "Noto Sans Symbols 2", serif; font-size: 1.6rem; color: var(--primary);
}
.symbol-btn.none { font-size: .8rem; color: var(--muted); }
.symbol-btn.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, #fff); }

.photo-box { display: flex; gap: 16px; align-items: center; margin-top: 6px; }
.photo-thumb { width: 96px; height: 120px; border-radius: 10px; border: 1.5px dashed var(--line); background: #faf7f5 center/cover no-repeat; flex: none; }

/* Templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tpl-card { border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); padding: 6px; cursor: pointer; text-align: center; font: inherit; }
.tpl-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.tpl-thumb { position: relative; width: 100%; aspect-ratio: 794 / 1123; overflow: hidden; border-radius: 4px; }
.tpl-thumb > div { position: absolute; top: 0; left: 0; width: 794px; height: 1123px; transform-origin: 0 0; pointer-events: none; }
.tpl-name { font-size: .85rem; font-weight: 600; padding: 6px 0 2px; }

/* Payment */
.price-line { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.price { font-size: 2rem; font-weight: 700; color: var(--primary); }
.price-old { color: var(--muted); }
.qr-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.qr-box { padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; width: 200px; height: 200px; }
.qr-box img, .qr-box canvas { width: 100% !important; height: 100% !important; }
.qr-meta p { margin: 4px 0; }
.mobile-only { display: none; margin-top: 8px; }
@media (hover: none) and (pointer: coarse) { .mobile-only { display: inline-flex; } }
.status { min-height: 1.2em; margin: 10px 0; font-weight: 500; }
.status.ok { color: #1b7f3b; font-size: 1.05rem; }
.status.err { color: #b3261e; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  border-radius: 10px; padding: 10px 18px; cursor: pointer; border: 1.5px solid transparent; text-decoration: none; transition: filter .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-link { background: none; border: none; color: var(--primary); padding: 6px 8px; }
.btn-link.danger { color: #9b3b3b; font-weight: 500; font-size: .85rem; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.wiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* Footer */
.footer { text-align: center; padding: 22px 16px; font-size: .88rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--card); }
.footer div { margin: 2px 0; }

/* Off-screen export page */
#exportRoot { position: fixed; left: -10000px; top: 0; width: 794px; height: 1123px; }

/* Confirmation dialog */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(30, 15, 20, .45); display: grid; place-items: center; padding: 16px; }
.dialog { max-width: 400px; width: 100%; }
.dialog p { margin: 0 0 18px; font-weight: 500; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Cashfree pay button */
.pay-phone { max-width: 360px; }
#gatewayBlock { margin: 6px 0 4px; }
#gatewayBlock .btn-lg { width: 100%; max-width: 360px; }
#gatewayBlock .hint { margin-top: 10px; }
.secure-note { color: #1b7f3b; }

/* Footer policy links */
.foot-links { margin-top: 6px !important; }
.foot-links a { color: var(--muted); }

/* Policy pages */
.legal { max-width: 820px; margin: 0 auto; }
.legal h1 { font-family: "Playfair Display", serif; color: var(--primary); margin: 8px 0 4px; }
.legal h2 { font-size: 1.1rem; color: var(--primary); margin: 26px 0 6px; }
.legal p, .legal li { color: var(--text); }
.legal .updated { color: var(--muted); font-size: .85rem; margin-top: 0; }
.legal .back { display: inline-block; margin-bottom: 8px; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Brand wordmark */
.brand { letter-spacing: -.01em; }
.brand-accent { color: #b07d0e; }
.brand-logo img { width: 36px; height: 36px; border-radius: 9px; }
