/*
 * Guna Darpan — the free Guna Milan page (templates/public/guna_darpan.html.twig).
 *
 * Its own file for the reason the home page has one: these rules are for one page, and folding
 * them into site.css would ship them to the FAQ and the terms. Tokens only, like every stylesheet
 * here (tools/check-tokens.mjs, tools/check-token-refs.mjs).
 */

/* ------------------------------------------------------------------- the form */

.gd-form {
  max-width: 68rem;
  margin: 0 auto clamp(var(--space-10), 6vw, var(--space-16));
  scroll-margin-top: calc(var(--layout-header-h) + var(--space-4));
}

.gd-people {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}

.gd-join {
  display: none;
}

@media (min-width: 56rem) {
  .gd-people {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .gd-join {
    display: grid;
    place-items: center;
    align-self: center;
    width: 3.25rem;
    height: 3.25rem;
    color: var(--brand-accent-600);
    background: var(--bg-surface);
    border: 1px solid var(--brand-accent-200);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-2);
  }
}

.gd-person {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  margin: 0;
}

/* A legend drawn as a heading inside the card, not notched into its border. */
.gd-legend {
  float: left;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--brand-secondary-700);
}

.gd-legend + * {
  clear: both;
}

.gd-legend-mark {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding-inline: var(--space-2);
  font-size: var(--text-sm);
  color: var(--brand-accent-600);
  background: var(--bg-sunken);
  border: 1px solid var(--brand-accent-200);
  border-radius: var(--radius-full);
}

.gd-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.gd-field {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}

.gd-field label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-secondary);
}

.gd-field select,
.gd-field input {
  width: 100%;
  min-height: var(--layout-tap-target);
  padding: 0 var(--space-3);
  font: inherit;
  font-size: var(--text-sm);
  color: var(--text-field);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
}

.gd-field select:focus-visible,
.gd-field input:focus-visible {
  border-color: var(--brand-primary-600);
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.gd-field [aria-invalid='true'] {
  border-color: var(--status-danger-600);
}

.gd-error {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--status-danger-700);
  background: var(--status-danger-100);
  border-radius: var(--radius-md);
}

/* ------------------------------------------------------------- the calculator */

/*
 * A button that looks like one (2026-10-11). It was underlined words, and the owner asked
 * for the site's underlined controls to look like the sign-in page's buttons. Dashed, in the
 * gold of the panel it opens, so the two read as one thing: the edge goes solid on hover and
 * once the panel is open.
 */
.gd-calc-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: start;
  min-height: var(--layout-tap-target);
  padding: var(--space-2) var(--space-4);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  text-align: left;
  color: var(--brand-primary-800);
  background: var(--bg-surface);
  border: 1px dashed var(--brand-accent-500);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
}

.gd-calc-toggle:hover,
.gd-calc-toggle[aria-expanded='true'] {
  border-style: solid;
  background: var(--brand-primary-100);
}

.gd-calc-toggle svg {
  flex-shrink: 0;
}

.gd-calc-toggle[hidden],
.gd-calc[hidden],
.gd-places[hidden],
.gd-actions [hidden] {
  display: none;
}

.gd-calc {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-sunken);
  border: 1px dashed var(--brand-accent-200);
  border-radius: var(--radius-lg);
}

.gd-calc .btn {
  justify-self: start;
}

.gd-combo {
  position: relative;
}

.gd-places {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--space-1));
  left: 0;
  right: 0;
  max-height: 17rem;
  margin: 0;
  padding: var(--space-1);
  overflow-y: auto;
  list-style: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-3);
}

.gd-places [role='option'] {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.gd-places [role='option'] small {
  display: block;
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

.gd-places [role='option'][aria-selected='true'],
.gd-places [role='option']:hover {
  background: var(--brand-primary-100);
}

.gd-hint {
  margin: 0;
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

.gd-calc-out:empty {
  display: none;
}

.gd-calc-out {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: var(--bg-surface);
  border-left: 3px solid var(--brand-accent-600);
  border-radius: var(--radius-md);
}

.gd-calc-out p {
  margin: 0;
}

.gd-calc-out strong {
  color: var(--text-primary);
}

.gd-calc-out .gd-calc-warn {
  color: var(--status-danger-700);
}

.gd-submit {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  margin-top: var(--space-8);
  text-align: center;
}

.gd-privacy {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-size: var(--text-2xs);
  color: var(--text-muted);
}

/* ----------------------------------------------------------------- the reading */

.gd-result {
  scroll-margin-top: var(--layout-header-h);
}

.gd-result:focus {
  outline: none;
}

.gd-summary {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  max-width: 60rem;
  margin: 0 auto;
}

@media (min-width: 44rem) {
  .gd-summary {
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--space-10);
    padding: var(--space-8) var(--space-10);
  }
}

.gd-ring {
  position: relative;
  justify-self: center;
  width: 11rem;
  height: 11rem;
}

.gd-ring svg {
  width: 100%;
  height: 100%;
  rotate: -90deg;
}

.gd-ring-track {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 10;
}

.gd-ring-fill {
  fill: none;
  stroke: var(--brand-primary-700);
  stroke-width: 10;
  stroke-linecap: round;
  animation: gd-ring-in 1.1s var(--ease-out) both;
}

.gd-ring--below .gd-ring-fill {
  stroke: var(--status-warning-700);
}

.gd-ring--acceptable .gd-ring-fill {
  stroke: var(--brand-accent-600);
}

.gd-ring--excellent .gd-ring-fill {
  stroke: var(--brand-success-700);
}

/* Towards the value the SVG attribute holds: a keyframe with no `to` ends at the element's own. */
@keyframes gd-ring-in {
  from {
    stroke-dasharray: 0 400;
  }
}

.gd-ring-score {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}

.gd-ring-score strong {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  line-height: 1;
  color: var(--brand-secondary-700);
}

.gd-ring-score span {
  margin-top: var(--space-1);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.gd-verdict h2 {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.gd-verdict > p {
  margin: 0;
  color: var(--text-secondary);
}

.gd-pair {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-8);
  margin: var(--space-5) 0;
}

.gd-pair dt,
.gd-koota-sides dt {
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.gd-pair dd {
  margin: 0;
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.gd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}

.gd-subhead {
  max-width: 60rem;
  margin: var(--space-12) auto var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  color: var(--brand-secondary-700);
}

.gd-kootas,
.gd-doshas {
  display: grid;
  gap: var(--space-4);
  max-width: 60rem;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

@media (min-width: 44rem) {
  .gd-kootas,
  .gd-doshas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gd-koota,
.gd-dosha {
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}

.gd-koota--full {
  border-color: var(--brand-accent-200);
}

.gd-koota-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.gd-koota-head h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--brand-secondary-700);
}

.gd-koota-head h4 span {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  color: var(--text-muted);
}

.gd-koota-score {
  margin: 0;
  white-space: nowrap;
  color: var(--text-muted);
}

.gd-koota-score strong {
  font-size: var(--text-xl);
  color: var(--text-primary);
}

.gd-bar {
  height: 0.5rem;
  margin: var(--space-3) 0 var(--space-4);
  overflow: hidden;
  background: var(--bg-sunken);
  border-radius: var(--radius-full);
}

.gd-bar span {
  display: block;
  width: var(--share);
  height: 100%;
  background: var(--brand-primary-700);
  border-radius: inherit;
  animation: gd-bar-in 0.9s var(--ease-out) both;
}

.gd-koota--full .gd-bar span {
  background: var(--brand-success-700);
}

@keyframes gd-bar-in {
  from {
    width: 0;
  }
}

.gd-koota-sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-3);
}

.gd-koota-sides dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.gd-koota-reason,
.gd-dosha p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.gd-koota-caveat {
  margin: var(--space-2) 0 0;
  font-size: var(--text-2xs);
  font-style: italic;
  color: var(--text-muted);
}

.gd-dosha {
  border-left-width: 4px;
}

.gd-dosha--present {
  border-left-color: var(--status-danger-600);
}

.gd-dosha--absent {
  border-left-color: var(--brand-success-700);
}

.gd-dosha--unknown {
  border-left-color: var(--border-strong);
}

.gd-dosha h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  font-size: var(--text-md);
  color: var(--text-primary);
}

.gd-dosha-mark {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  color: var(--text-inverse);
  background: var(--text-muted);
  border-radius: var(--radius-full);
}

.gd-dosha--present .gd-dosha-mark {
  background: var(--status-danger-600);
}

.gd-dosha--absent .gd-dosha-mark {
  background: var(--brand-success-700);
}

.gd-dosha-state {
  margin-left: auto;
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.gd-dosha .gd-eased-title {
  margin-top: var(--space-3);
  font-weight: var(--weight-medium);
  color: var(--brand-success-700);
}

.gd-eased {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.gd-note {
  max-width: 60rem;
  margin: var(--space-12) auto 0;
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--brand-accent-200);
  border-radius: var(--radius-lg);
}

.gd-note h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  color: var(--brand-secondary-700);
}

.gd-note p {
  margin: 0;
  color: var(--text-secondary);
}

.gd-noresult {
  text-align: center;
  color: var(--text-secondary);
}

/* ------------------------------------------------------------- how it works */

.gd-explain-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 40rem) {
  .gd-explain-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64rem) {
  .gd-explain-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.gd-explain-card {
  padding: var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.gd-explain-points {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  line-height: 1;
  color: var(--brand-accent-600);
}

.gd-explain-points span {
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-muted);
}

.gd-explain-card h3 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  color: var(--brand-secondary-700);
}

.gd-explain-card p {
  margin: 0 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.gd-explain-card .gd-explain-about {
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}

.gd-bands {
  max-width: 48rem;
  margin: var(--space-12) auto 0;
}

.gd-bands h3 {
  font-family: var(--font-display);
  color: var(--brand-secondary-700);
}

.gd-bands ul {
  padding-left: var(--space-5);
  color: var(--text-secondary);
}

.gd-bands li + li {
  margin-top: var(--space-2);
}

.gd-faq .faq-list {
  max-width: 48rem;
  margin: 0 auto;
}

.gd-credit {
  max-width: 48rem;
  margin: var(--space-8) auto 0;
  font-size: var(--text-2xs);
  text-align: center;
  color: var(--text-muted);
}

.gd-cta-inner {
  display: grid;
  gap: var(--space-5);
  align-items: center;
  max-width: 60rem;
  padding: var(--space-8);
  background: var(--bg-band-blush);
  border-radius: var(--radius-xl);
}

@media (min-width: 44rem) {
  .gd-cta-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.gd-cta h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
}

.gd-cta p {
  margin: 0;
  color: var(--text-secondary);
}

@media (max-width: 30rem) {
  .gd-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gd-ring-fill,
  .gd-bar span {
    animation: none;
  }
}

/* A reading printed for a parent: the reading, and nothing around it. */
@media print {
  .site-header,
  .tabbar,
  .nav-panel,
  .site-footer,
  .gd-form,
  .gd-explain,
  .gd-faq,
  .gd-cta,
  .gd-actions,
  .doc-head .crumbs {
    display: none !important;
  }

  .gd-result {
    background: none;
  }

  .gd-koota,
  .gd-dosha,
  .gd-summary {
    break-inside: avoid;
    box-shadow: none;
  }

  .gd-ring-fill,
  .gd-bar span {
    animation: none;
  }
}
