/* ==========================================================================
   SORZIA — My Premium Kundali
   Scoped entirely under .pk-* so it cannot affect any existing page. Every
   colour resolves to a token already defined in base.css: this feature adds
   a page, not a second design system.
   ========================================================================== */

/* The [hidden] attribute is only a `display: none` DEFAULT, and any explicit
   display value in a later rule beats it. Several blocks below are laid out
   with flex/grid and are toggled by `hidden`, so without this they would be
   permanently visible. Scoped to this feature's own elements. */
.pk-place-results[hidden],
.pk-place-chosen[hidden],
.pk-alert[hidden],
.pk-progress[hidden],
.pk-result[hidden],
.pk-snapshot[hidden],
.pk-field-error[hidden],
#pk-form[hidden] {
  display: none !important;
}

/* --- Hero ---------------------------------------------------------------- */
.pk-hero {
  padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  position: relative;
}

.pk-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.75rem, 5vw, 4rem);
  align-items: center;
}

.pk-eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin: 0 0 1rem;
}

.pk-title {
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  line-height: 1.03;
  margin: 0;
  letter-spacing: -0.015em;
}

.pk-title-accent {
  background: linear-gradient(96deg, var(--gold-mid) 4%, var(--gold-lift) 42%, var(--gold-bright) 66%, var(--gold) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pk-subtitle {
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  font-style: italic;
  color: var(--gold-bright);
  margin: 0.5rem 0 0;
}

.pk-systems {
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 1rem 0 0;
  /* Must be free to wrap: the three system names plus tracking are wider
     than a 360px viewport on one line. */
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
}

/* Nothing in this feature may widen the page. Long unbroken strings (a place
   name, a report id, a pasted name) wrap instead of forcing a scrollbar. */
.pk-hero,
.pk-value,
.pk-form-section,
.pk-promise { overflow-x: clip; }

.pk-lede,
.pk-value-item p,
.pk-promise-grid p,
.pk-snap-row dd,
.pk-place-chosen strong,
.pk-place-chosen span,
.pk-result-for { overflow-wrap: anywhere; }

.pk-lede {
  color: var(--text-muted);
  max-width: 34rem;
  margin: 1.35rem 0 0;
  line-height: 1.68;
}

.pk-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  margin-top: 2rem;
}

.pk-hero-note {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.pk-hero-note .icon { width: 15px; height: 15px; }

/* Report preview mock ------------------------------------------------------ */
.pk-hero-visual { display: flex; justify-content: center; }

.pk-mock {
  width: min(330px, 100%);
  aspect-ratio: 1 / 1.414;      /* A4 */
  border-radius: 6px;
  padding: 1px;
  background: linear-gradient(160deg, rgba(212,173,89,0.55), rgba(212,173,89,0.08) 45%, rgba(212,173,89,0.30));
  box-shadow: 0 26px 60px -28px rgba(0,0,0,0.85), 0 2px 10px rgba(0,0,0,0.4);
  transform: rotate(-1.6deg);
}

.pk-mock-inner {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(168deg, #10192B 0%, #0A1220 60%, #070E19 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 2.25rem) 1.25rem;
  position: relative;
  overflow: hidden;
  color: var(--gold-soft);
}

.pk-mock-brand {
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  color: var(--gold-bright);
  margin-bottom: auto;
}

.pk-mock-title {
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(0.98rem, 3vw, 1.2rem);
  letter-spacing: 0.03em;
  color: var(--ivory);
  text-align: center;
}

.pk-mock-sub {
  font-style: italic;
  font-size: 0.82rem;
  color: var(--gold-bright);
  margin: 0.3rem 0 auto;
}

.pk-mock-wheel {
  position: absolute;
  inset: auto 0 -14% 0;
  margin: auto;
  width: 78%;
  color: var(--gold-soft);
  opacity: 0.42;
}

/* --- Value row ----------------------------------------------------------- */
.pk-value { padding: clamp(1.5rem, 4vw, 2.5rem) 0; }

.pk-value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.pk-value-item {
  border: 1px solid var(--line, rgba(212,173,89,0.16));
  border-radius: 10px;
  padding: 1.5rem 1.4rem;
  background: var(--surface-1, rgba(255,255,255,0.02));
}

.pk-value-item .icon-lg { color: var(--gold-soft); width: 26px; height: 26px; }
.pk-value-item h3 { margin: 0.85rem 0 0.5rem; font-size: 1.05rem; }
.pk-value-item p { margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* --- Form ---------------------------------------------------------------- */
.pk-form-section { padding: clamp(2rem, 6vw, 4rem) 0; }

.pk-form-shell { max-width: 46rem; }

.pk-section-head { text-align: center; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.pk-section-head h2 { margin: 0 0 0.6rem; font-size: clamp(1.5rem, 4vw, 2rem); }
.pk-section-head p { margin: 0 auto; max-width: 34rem; color: var(--text-muted); font-size: 0.92rem; }

.pk-form {
  border: 1px solid var(--line, rgba(212,173,89,0.16));
  border-radius: 12px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background: var(--surface-1, rgba(255,255,255,0.02));
  display: grid;
  gap: 1.25rem;
}

.pk-field { display: grid; gap: 0.45rem; min-width: 0; }

.pk-field label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* 16px minimum: anything smaller makes iOS Safari zoom on focus, which on a
   birth-details form feels broken. */
.pk-field .input {
  width: 100%;
  font-size: 16px;
  padding: 0.8rem 0.9rem;
  min-height: 48px;          /* comfortable touch target */
}

.pk-field-hint { margin: 0; font-size: 0.78rem; color: var(--text-dim); }

.pk-place-status { margin: 0.3rem 0 0; font-size: 0.78rem; min-height: 1.1em; }
.pk-place-status-busy { color: var(--text-dim); }
.pk-place-status-error { color: #E4A08A; }

.pk-field-error {
  margin: 0;
  font-size: 0.8rem;
  color: #E4A08A;
}

.pk-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1.25rem;
}

/* Birthplace autocomplete -------------------------------------------------- */
.pk-place-field { position: relative; }

.pk-place-results {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0.3rem;
  border: 1px solid var(--line, rgba(212,173,89,0.2));
  border-radius: 10px;
  background: #0C1421;
  box-shadow: 0 18px 40px -20px rgba(0,0,0,0.9);
  max-height: 16rem;
  overflow-y: auto;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 30;
  -webkit-overflow-scrolling: touch;
}

.pk-place-results li { margin: 0; }

.pk-place-results button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--text);
  padding: 0.7rem 0.75rem;
  border-radius: 7px;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.35;
}

.pk-place-results button:hover,
.pk-place-results button:focus-visible,
.pk-place-results button.is-active {
  background: rgba(212,173,89,0.14);
  color: var(--gold-lift);
  outline: none;
}

.pk-place-results .pk-place-meta {
  display: block;
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.pk-place-results .pk-place-empty {
  padding: 0.7rem 0.75rem;
  font-size: 0.86rem;
  color: var(--text-dim);
}

.pk-place-chosen {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid rgba(120,200,150,0.28);
  background: rgba(120,200,150,0.07);
  border-radius: 9px;
  padding: 0.7rem 0.85rem;
}

.pk-place-chosen .icon { color: #7BC79A; flex: none; width: 18px; height: 18px; }
.pk-place-chosen strong { display: block; font-size: 0.92rem; font-weight: 600; }
.pk-place-chosen span { display: block; font-size: 0.76rem; color: var(--text-dim); margin-top: 0.1rem; }
.pk-place-chosen > div { min-width: 0; flex: 1; }

.pk-place-change {
  background: none;
  border: 0;
  color: var(--gold-bright);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.3rem;
  flex: none;
}

/* Privacy + submit --------------------------------------------------------- */
.pk-privacy {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  border-top: 1px solid var(--line, rgba(212,173,89,0.12));
  padding-top: 1.1rem;
}

.pk-privacy .icon { color: var(--gold-soft); flex: none; width: 16px; height: 16px; margin-top: 0.15rem; }
.pk-privacy p { margin: 0; font-size: 0.82rem; color: var(--text-dim); line-height: 1.6; }
.pk-privacy a { color: var(--gold-bright); }

.pk-submit-row { margin-top: 0.25rem; }
#pk-submit[disabled] { opacity: 0.55; cursor: progress; }

/* Alerts ------------------------------------------------------------------- */
.pk-alert {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  border: 1px solid rgba(212,173,89,0.28);
  background: rgba(212,173,89,0.07);
  border-radius: 9px;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
}

.pk-alert .icon { color: var(--gold-soft); flex: none; width: 17px; height: 17px; margin-top: 0.1rem; }
.pk-alert p { margin: 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.6; }
.pk-alert div { font-size: 0.86rem; color: var(--text-muted); line-height: 1.6; }

.pk-alert-error { border-color: rgba(214,120,96,0.4); background: rgba(214,120,96,0.09); }
.pk-alert-error .icon { color: #E4A08A; }

/* --- Progress ------------------------------------------------------------- */
.pk-progress {
  border: 1px solid var(--line, rgba(212,173,89,0.16));
  border-radius: 12px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: var(--surface-1, rgba(255,255,255,0.02));
  text-align: left;
}

.pk-progress h3 { margin: 0 0 1.25rem; font-size: 1.15rem; text-align: center; }

.pk-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; max-width: 24rem; margin-inline: auto; }

.pk-stages li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.3s ease;
}

.pk-stage-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-dim);
  opacity: 0.35;
  flex: none;
  transition: all 0.3s ease;
}

.pk-stages li.is-active { color: var(--gold-bright); }
.pk-stages li.is-active .pk-stage-dot {
  background: var(--gold-bright); opacity: 1;
  box-shadow: 0 0 0 4px rgba(212,173,89,0.16);
  animation: pk-pulse 1.4s ease-in-out infinite;
}

.pk-stages li.is-done { color: var(--text-muted); }
.pk-stages li.is-done .pk-stage-dot { background: #7BC79A; opacity: 1; animation: none; box-shadow: none; }

@keyframes pk-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(212,173,89,0.14); }
  50%      { box-shadow: 0 0 0 7px rgba(212,173,89,0.05); }
}

@media (prefers-reduced-motion: reduce) {
  .pk-stages li.is-active .pk-stage-dot { animation: none; }
  .pk-mock { transform: none; }
}

/* --- Result --------------------------------------------------------------- */
.pk-result {
  border: 1px solid rgba(212,173,89,0.32);
  border-radius: 12px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: linear-gradient(168deg, rgba(212,173,89,0.09), rgba(255,255,255,0.015));
}

.pk-result-head { text-align: center; }
.pk-result-head .icon-lg { width: 34px; height: 34px; color: #7BC79A; }
.pk-result-head h3 { margin: 0.7rem 0 0.4rem; font-size: clamp(1.3rem, 4vw, 1.7rem); }
.pk-result-for { margin: 0; color: var(--text-muted); font-size: 0.94rem; }
.pk-result-id { margin: 0.35rem 0 0; font-size: 0.76rem; color: var(--text-dim); letter-spacing: 0.05em; }

.pk-result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.6rem 0 0;
}

.pk-result-actions .btn { min-height: 48px; }
.pk-result-actions .icon { width: 17px; height: 17px; margin-right: 0.4rem; }

/* Snapshot ----------------------------------------------------------------- */
.pk-snapshot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  margin-top: 1.9rem;
}

.pk-snap-card {
  border: 1px solid var(--line, rgba(212,173,89,0.14));
  border-radius: 10px;
  padding: 1.1rem 1.15rem;
  background: rgba(0,0,0,0.16);
}

.pk-snap-card h4 {
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.pk-snap-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(212,173,89,0.09);
  font-size: 0.85rem;
}

.pk-snap-row:last-child { border-bottom: 0; }
.pk-snap-row dt { color: var(--text-dim); margin: 0; }
.pk-snap-row dd { margin: 0; color: var(--text); font-weight: 600; text-align: right; }

/* --- Promise -------------------------------------------------------------- */
.pk-promise { padding: clamp(2rem, 6vw, 4rem) 0 clamp(3rem, 8vw, 5rem); }
.pk-promise-title { text-align: center; font-size: clamp(1.35rem, 4vw, 2rem); margin: 0 0 2rem; }

.pk-promise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.pk-promise-grid strong { display: block; color: var(--gold-bright); margin-bottom: 0.4rem; font-size: 0.98rem; }
.pk-promise-grid p { margin: 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.65; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 899px) {
  .pk-hero-grid { grid-template-columns: 1fr; }
  .pk-hero-visual { order: -1; }
  .pk-mock { width: min(230px, 62%); }
  .pk-hero-copy { text-align: center; }
  .pk-lede { margin-inline: auto; }
  .pk-hero-actions { justify-content: center; }
  .pk-systems { justify-content: center; }
  .pk-result-actions .btn { width: 100%; }
}

@media (max-width: 520px) {
  .pk-form { padding: 1.15rem; }
  .pk-snap-row { flex-direction: column; gap: 0.15rem; }
  .pk-snap-row dd { text-align: left; }
  .pk-place-chosen { flex-wrap: wrap; }
}

/* Language / gender selectors -------------------------------------------- */
.pk-optional {
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-dim);
  font-size: 0.72rem;
}


/* ==========================================================================
   Visual System 2.0 additions
   ========================================================================== */

/* Hero fact rail — three numbers that answer "what do I actually get". */
.pk-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.pk-hero-facts li {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: .82rem;
  letter-spacing: .02em;
  opacity: .82;
}
.pk-hero-facts span {
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  opacity: 1;
}

/* Page stack behind the cover mock. Purely decorative, so it is inside the
   aria-hidden hero visual and never announced. */
.pk-hero-visual { position: relative; }
.pk-stack {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.pk-sheet {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  border: 1px solid rgba(176, 141, 63, .28);
  background: linear-gradient(160deg, rgba(255, 253, 248, .10), rgba(255, 253, 248, .03));
  transform-origin: 50% 100%;
}
.pk-sheet-2 { transform: translate(14px, -12px) rotate(2.4deg); opacity: .55; }
.pk-sheet-3 { transform: translate(27px, -23px) rotate(4.8deg); opacity: .3; }
.pk-mock { position: relative; z-index: 2; }

/* Numbered steps inside the form. */
.pk-step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0 4px;
  padding-top: 22px;
  border-top: 1px solid var(--pk-line, rgba(28, 24, 18, .1));
}
.pk-form > .pk-step:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.pk-step-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pk-accent, #b08d3f);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pk-step-title {
  margin: 0;
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .01em;
}

@media (max-width: 640px) {
  .pk-hero-facts { gap: 8px 18px; }
  .pk-hero-facts span { font-size: 1.25rem; }
  .pk-sheet-2, .pk-sheet-3 { display: none; }
}

/* A viewer who prefers reduced motion gets the stack without the tilt. */
@media (prefers-reduced-motion: reduce) {
  .pk-sheet-2, .pk-sheet-3 { transform: none; opacity: .18; }
}

/* ==========================================================================
   Sign-in gate (v22) — deliberately quiet, not a payment wall
   ========================================================================== */
.pk-signin-gate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(24px, 5vw, 44px) clamp(16px, 4vw, 32px);
  border: 1px solid var(--line, rgba(212,173,89,0.16));
  border-radius: 18px;
  background: var(--surface-1, rgba(255,255,255,0.02));
  text-align: center;
}
.pk-signin-gate[aria-busy="true"] { opacity: .6; pointer-events: none; }
.pk-signin-free {
  margin: 4px 0 0;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-bright);
}
.pk-signin-note {
  margin: 0;
  max-width: 32rem;
  font-size: .88rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.pk-signin-gate .pk-alert-error { width: 100%; max-width: 30rem; }

.pk-account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(212,173,89,0.16));
  background: var(--surface-1, rgba(255,255,255,0.02));
  font-size: .84rem;
  color: var(--text-muted);
}
.pk-account-strip strong { color: var(--ivory); }
.pk-signout {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: .8rem;
  color: var(--gold-soft);
  text-decoration: underline;
  cursor: pointer;
}
.pk-signout:hover { color: var(--gold-bright); }

.pk-history {
  margin: 0 0 22px;
  border: 1px solid var(--line, rgba(212,173,89,0.16));
  border-radius: 12px;
  padding: 4px 16px;
}
.pk-history summary {
  padding: 12px 0;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ivory);
}
.pk-history-table { width: 100%; border-collapse: collapse; font-size: .82rem; margin-bottom: 8px; }
.pk-history-table th, .pk-history-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line, rgba(212,173,89,0.1));
  color: var(--text-muted);
}
.pk-history-table th { font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.pk-history-note { margin: 4px 0 10px; font-size: .76rem; color: var(--text-dim); }

@media (max-width: 640px) {
  .pk-account-strip { flex-direction: column; align-items: flex-start; gap: 4px; border-radius: 12px; }
  .pk-history-table { display: block; overflow-x: auto; }
}
