/* ===== Janam Kundli — cosmic theme ===== */
:root {
  --night: #0B0820;
  --deep: #140E33;
  --indigo: #24185A;
  --violet: #3B2A85;
  --gold: #F2C46D;
  --gold-2: #E9A93B;
  --saffron: #F59E0B;
  --rose: #F472B6;
  --text: #F5EFE6;
  --muted: #B9AFCF;
  --line: rgba(242, 196, 109, .28);
  --glass: rgba(255, 255, 255, .055);
  --glass-2: rgba(255, 255, 255, .09);
  --ok: #4ADE80;
  --warn: #FB7185;
  --mild: #FBBF24;
  --radius: 20px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 700px at 80% -10%, #2B1C6B 0%, transparent 60%),
              radial-gradient(900px 600px at -10% 30%, #3A1450 0%, transparent 55%),
              var(--night);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Noto Sans", "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu",
    "Noto Sans Kannada", "Noto Sans Malayalam", "Noto Sans Gujarati", "Noto Sans Gurmukhi", "Noto Sans Oriya",
    system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nebula { position: fixed; inset: -20%; z-index: 0; pointer-events: none; opacity: .35;
  background: radial-gradient(closest-side, rgba(244,114,182,.18), transparent), radial-gradient(closest-side at 30% 70%, rgba(99,102,241,.22), transparent);
  animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(4%, -3%) rotate(6deg); } }
.wrap { max-width: 940px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: rgba(11, 8, 32, .65); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: .3px; color: var(--gold); }
.brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 0 14px rgba(242,196,109,.35); }
.langsel select { background: var(--glass-2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font: inherit; font-size: 15px; line-height: 1.3; }
.langsel option { color: #111; }

/* hero */
.hero { text-align: center; padding: 28px 0 6px; }
.wheel { position: relative; width: min(260px, 66vw); aspect-ratio: 1; margin: 0 auto 10px; filter: drop-shadow(0 0 28px rgba(242,196,109,.25)); }
.wheel .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.wheel .outer { animation: spin 90s linear infinite; }
.wheel .inner { animation: spin 26s linear infinite reverse; }
.wheel .r1 { fill: none; stroke: var(--gold); stroke-width: 1.6; opacity: .9; }
.wheel .r2 { fill: none; stroke: var(--gold); stroke-width: .8; opacity: .5; }
.wheel .r3 { fill: none; stroke: var(--rose); stroke-width: .8; stroke-dasharray: 3 6; opacity: .7; }
.wheel .tick { stroke: var(--gold); stroke-width: .8; opacity: .6; }
.wheel .glyph { fill: var(--gold); font-size: 20px; font-family: "Segoe UI Symbol", "Apple Symbols", "Noto Sans Symbols", "Noto Sans Symbols 2", serif; }
.wheel .pl { fill: var(--gold); }
.wheel .p2 { fill: var(--rose); }
.wheel .p3 { fill: #A5B4FC; }
.wheel .core { position: absolute; inset: 36%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #FFE7A8, var(--gold-2) 55%, #9A5B12); box-shadow: 0 0 40px rgba(242,196,109,.55), inset 0 0 18px rgba(0,0,0,.25);
  animation: pulse 4s ease-in-out infinite; }
.wheel .core .om { width: 58%; height: auto; color: #3A1A05; display: block; filter: drop-shadow(0 1px 0 rgba(255,231,168,.5)); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 70px rgba(242,196,109,.8), inset 0 0 18px rgba(0,0,0,.25); } }
.hero-title { font-size: clamp(30px, 7vw, 46px); margin: 8px 0 4px; line-height: 1.15;
  background: linear-gradient(90deg, #FFE7A8, var(--gold), #F9A8D4, var(--gold)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 8s linear infinite; }
@keyframes shimmer { to { background-position: 300% 0; } }
.hero-sub { color: var(--muted); margin: 0 auto 8px; max-width: 520px; }

/* cards */
.card { position: relative; border-radius: var(--radius); padding: 22px; margin: 18px 0; }
.glass { background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.025));
  border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
h1 { font-size: 26px; margin: 0 0 6px; line-height: 1.3; }
h2 { font-size: 20px; color: var(--gold); margin: 0 0 14px; line-height: 1.35; display: flex; align-items: center; gap: 10px; }
h2 .ic { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(242,196,109,.14); border: 1px solid var(--line); font-size: 16px; flex: none; }
.sub { color: var(--muted); margin: 0 0 18px; }

/* language grid */
.langgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.langgrid button { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 14px 10px; font: inherit; cursor: pointer; text-align: center; color: var(--text);
  transition: transform .2s, background .2s, box-shadow .2s; }
.langgrid button:hover, .langgrid button:focus-visible { transform: translateY(-3px); background: rgba(242,196,109,.12); box-shadow: 0 8px 24px rgba(242,196,109,.18); outline: none; }
.langgrid b { display: block; font-size: 20px; color: var(--gold); }
.langgrid small { color: var(--muted); }

/* form */
form { display: grid; gap: 12px; }
.f { display: grid; gap: 6px; font-weight: 600; font-size: 15px; position: relative; color: var(--text); }
.f input, .f select { font: inherit; font-weight: 400; line-height: 1.35; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(10, 7, 30, .55); color: var(--text); width: 100%; transition: border-color .2s, box-shadow .2s; }
.f input::placeholder { color: rgba(185,175,207,.6); }
.f input:focus, .f select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,196,109,.18); }
.f select option { color: #111; }
.f select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
/* date & time: gold icons on the right; the native picker button stays clickable but invisible over the icon */
.f input[type="date"], .f input[type="time"] { position: relative; padding-right: 48px; background-repeat: no-repeat;
  background-position: right 14px center; background-size: 22px 22px; -webkit-appearance: none; appearance: none; text-align: left; }
.f input[type="date"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2C46D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16' rx='2.5'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3Ccircle cx='8' cy='14' r='1' fill='%23F2C46D'/%3E%3Ccircle cx='12' cy='14' r='1' fill='%23F2C46D'/%3E%3Ccircle cx='16' cy='14' r='1' fill='%23F2C46D'/%3E%3C/svg%3E"); }
.f input[type="time"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F2C46D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E"); }
.f input[type="date"]::-webkit-calendar-picker-indicator, .f input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute; right: 0; top: 0; width: 48px; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.f input[type="date"]::-webkit-date-and-time-value, .f input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.35em; }
.f input[type="date"]:disabled, .f input[type="time"]:disabled { opacity: .55; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help { color: var(--muted); font-size: 13.5px; margin: -6px 0 0; }
.chk { display: flex; gap: 10px; align-items: center; font-size: 14.5px; line-height: 1.4; color: var(--muted); cursor: pointer; }
.chk input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.err { color: var(--warn); font-weight: 600; margin: 0; }
.btn { font: inherit; font-weight: 800; line-height: 1.3; min-height: 52px; border-radius: 14px; padding: 12px 18px; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.btn.primary { position: relative; overflow: hidden; background: linear-gradient(135deg, #FFD98A, var(--gold-2) 50%, #E07A1F); color: #2A1405; font-size: 17px;
  box-shadow: 0 10px 30px rgba(233,169,59,.35); transition: transform .15s, box-shadow .2s; }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(233,169,59,.5); }
.shine::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--glass-2); }

.sugg { list-style: none; margin: 0; padding: 6px; position: absolute; top: 100%; left: 0; right: 0; background: #1A1240; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,.5); z-index: 30; max-height: 280px; overflow-y: auto; font-weight: 400; }
.sugg li { padding: 10px; border-radius: 9px; cursor: pointer; }
.sugg li small { color: var(--muted); }
.sugg li[aria-selected="true"], .sugg li:hover { background: rgba(242,196,109,.14); }
.sugg li.none { color: var(--muted); cursor: default; }

/* loader */
.loader { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 22px;
  background: rgba(11, 8, 32, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadein .3s ease; }
.loader p { color: var(--gold); font-weight: 700; font-size: 18px; margin: 0; text-align: center; padding: 0 20px; }
.orbit { position: relative; width: 190px; height: 190px; }
.orbit .sun { position: absolute; inset: 30%; width: 40%; height: 40%; border-radius: 22%; box-shadow: 0 0 40px rgba(242,196,109,.6); animation: pulse 2s ease-in-out infinite; }
.orbit .o { position: absolute; border-radius: 50%; border: 1px dashed rgba(242,196,109,.35); animation: spin linear infinite; }
.orbit .o span { position: absolute; top: -6px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; }
.orbit .o1 { inset: 24%; animation-duration: 1.6s; } .orbit .o1 span { background: #A5B4FC; box-shadow: 0 0 12px #A5B4FC; width: 9px; height: 9px; }
.orbit .o2 { inset: 11%; animation-duration: 2.6s; } .orbit .o2 span { background: var(--rose); box-shadow: 0 0 12px var(--rose); }
.orbit .o3 { inset: 0; animation-duration: 4.2s; } .orbit .o3 span { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
@keyframes fadein { from { opacity: 0; } }

/* report */
.rhead { position: relative; overflow: hidden; border-radius: var(--radius); padding: 26px 22px; margin: 20px 0;
  background: linear-gradient(135deg, #2B1C6B, #4A1D5C 60%, #6B2A3A); border: 1px solid var(--line); box-shadow: 0 16px 50px rgba(0,0,0,.45); }
.rhead::before { content: "✦"; position: absolute; right: 18px; top: 6px; font-size: 90px; color: rgba(242,196,109,.12); animation: spin 30s linear infinite; }
.rhead h1 { color: var(--gold); font-size: 27px; }
.rhead p { margin: 4px 0 0; color: #E9DFF7; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.actions .btn { padding: 12px 16px; font-size: 15px; }
.badge { display: inline-block; margin-left: 8px; vertical-align: middle; font-size: 12px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
  color: #2A1405; background: linear-gradient(135deg, #FFD98A, var(--gold-2)); padding: 3px 10px; border-radius: 999px; }

.kgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.kv { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; transition: transform .2s, background .2s; }
.kv:hover { transform: translateY(-2px); background: var(--glass-2); }
.kv span { display: block; color: var(--muted); font-size: 13px; }
.kv b { display: block; color: var(--gold); font-size: 17px; margin-top: 2px; }
.kv b.good { color: var(--ok); } .kv b.bad { color: var(--warn); } .kv b.mildc { color: var(--mild); }
.kv.big b { font-size: 34px; line-height: 1.1; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.charts figure { margin: 0; }
.charts figcaption { text-align: center; font-weight: 700; color: var(--gold); margin-top: 10px; }
.kchart { width: 100%; height: auto; display: block; border-radius: 14px; background: rgba(10, 7, 30, .6); }
.kchart .frame { fill: none; stroke: var(--gold); stroke-width: 2.5; }
.kchart .cell { fill: rgba(36, 24, 90, .35); stroke: var(--gold); stroke-width: 1.3; stroke-opacity: .75; }
.kchart .cell.lagna { fill: rgba(242, 196, 109, .2); }
.kchart .mid { fill: rgba(59, 42, 133, .35); stroke: var(--gold); stroke-width: 1.3; stroke-opacity: .75; }
.kchart .num { fill: #FDBA74; font-size: 13px; font-weight: 700; }
.kchart .sname { fill: var(--muted); }
.kchart .asc { fill: var(--rose); font-weight: 800; }
.kchart .ascline { stroke: var(--rose); stroke-width: 2; }
.kchart .ctitle { fill: var(--gold); font-size: 15px; font-weight: 700; }
.kchart text { fill: var(--text); font-weight: 700; }
.kchart .rt { fill: var(--warn); }
.reveal.in .kchart .cell, .reveal.in .kchart .mid { animation: drawcell 1.2s ease both; }
@keyframes drawcell { from { fill-opacity: 0; stroke-opacity: 0; } }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(242,196,109,.15); vertical-align: top; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
tr.now td { background: rgba(242,196,109,.14); font-weight: 700; color: var(--gold); }
.tscroll { overflow-x: auto; }
.rtag { color: var(--warn); font-weight: 700; font-size: 13px; }

.reading p { margin: 0 0 12px; color: #EEE6FA; }
.reading h3 { font-size: 16px; color: var(--gold); margin: 18px 0 4px; }
.reading h3:first-child { margin-top: 0; }
.note { background: rgba(242,196,109,.08); border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.pill { display: inline-block; padding: 5px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; }
.pill.good { background: rgba(74,222,128,.14); color: var(--ok); border: 1px solid rgba(74,222,128,.35); }
.pill.mild { background: rgba(251,191,36,.14); color: var(--mild); border: 1px solid rgba(251,191,36,.35); }
.pill.bad { background: rgba(251,113,133,.14); color: var(--warn); border: 1px solid rgba(251,113,133,.35); }
.help { color: var(--muted); }

/* transit cards, remedies */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tcard { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.tcard .when { color: var(--muted); font-size: 13px; }
.tcard b { color: var(--gold); display: block; margin: 2px 0 6px; }
.tcard p { margin: 0; font-size: 14.5px; color: #EEE6FA; }
.rem dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 8px 0 0; font-size: 14.5px; }
.rem dt { color: var(--muted); }
.rem dd { margin: 0; color: var(--text); }

/* pro divider + upsell */
.prohead { text-align: center; margin: 34px 0 8px; }
.prohead h2 { justify-content: center; font-size: 24px; }
.prohead .line { height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); margin: 10px auto; max-width: 420px; }
.upsell { text-align: center; overflow: hidden; background: linear-gradient(160deg, rgba(242,196,109,.16), rgba(244,114,182,.08)); border: 1px solid rgba(242,196,109,.5); }
.upsell::before { content: ""; position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent, rgba(242,196,109,.15), transparent 30%); animation: spin 8s linear infinite; z-index: -1; }
.upsell h2 { justify-content: center; font-size: 22px; }
.upsell ul { list-style: none; padding: 0; margin: 14px auto 18px; max-width: 560px; text-align: left; display: grid; gap: 8px; }
.upsell li { padding-left: 28px; position: relative; color: #EEE6FA; }
.upsell li::before { content: "✦"; position: absolute; left: 4px; color: var(--gold); }
.upsell .price { font-size: 34px; font-weight: 900; color: var(--gold); display: block; margin-bottom: 10px; }

/* reveal animation */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

.foot { color: var(--muted); font-size: 13px; padding: 14px 0 44px; }
.foot .credits { font-size: 12px; opacity: .8; }

@media (max-width: 640px) {
  .charts { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .rhead h1 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* PDF / print: keep the cosmic theme (Save as PDF keeps backgrounds) */
@page { size: A4; margin: 0; }
@media print {
  html, body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #0B0820 !important; font-size: 12.5px; }
  #stars, .nebula, .top, #hero, #formScreen, #langScreen, .actions, .upsell, #loader { display: none !important; }
  .wrap { max-width: none; padding: 10mm 10mm 6mm; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .card, .rhead, .prohead, .kv, .tcard, tr { break-inside: avoid; page-break-inside: avoid; }
  .card, .glass { margin: 8px 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    background: linear-gradient(160deg, #1D1547, #150F38) !important; }
  .rhead { background: linear-gradient(135deg, #2B1C6B, #4A1D5C 60%, #6B2A3A) !important; box-shadow: none; }
  .rhead::before { animation: none; }
  .kv, .tcard { background: #221A52 !important; }
  .charts { grid-template-columns: 1fr 1fr; }
  .tscroll { overflow: visible; }
  .foot { color: #B9AFCF; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
