/*
  Phone Addiction Test. Scoped to .pat-page and built only on the
  shared tokens in styles.css (:root). No gradients, no decorative shadows;
  elevation comes from tonal surfaces, matching the iOS app and the
  screen-time-reduction-planner tool.
*/

.pat-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Hero and tool share one surface so the tool owns the first screen. */
.pat-page.seo-design-template .how-hero.pat-hero {
  display: block;
  min-height: 0;
  padding: 72px 0 56px;
}

.pat-page.seo-design-template .pat-hero .text-card h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.1;
}

.pat-h1-payoff {
  display: block;
}

.pat-page.seo-design-template .pat-hero .lead {
  max-width: 640px;
  margin: 0 auto;
}

.pat-disclaimer {
  max-width: 560px;
  margin: 14px auto 0;
  color: var(--fella-secondary-text);
  font-size: 13px;
  line-height: 1.45;
}

/* Tool shell — matches vs-compare width for exact horizontal alignment */
.pat-tool {
  max-width: none;
  margin: 36px auto 0;
  text-align: left;
}

.pat-card {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: #ffffff;
}

.pat-card:focus-visible {
  outline: 2px solid var(--fella-accent);
  outline-offset: 2px;
}

/* Progress */
.pat-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pat-progress-label {
  color: var(--fella-secondary-text);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.pat-progress-count {
  color: var(--fella-secondary-text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.pat-progress-track {
  height: 6px;
  margin-bottom: 24px;
  border-radius: var(--radius-pill);
  background: var(--fella-secondary-fill);
  overflow: hidden;
}

.pat-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: var(--fella-primary-text);
  transition: width 280ms cubic-bezier(0.2, 0, 0, 1);
}

/* Question — all copy same colour, like the lighter 1. 2. */
.pat-question {
  margin: 0 0 20px;
  color: var(--fella-secondary-text);
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.pat-question-number {
  color: var(--fella-secondary-text);
  font-weight: 400;
}

.pat-answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pat-answer {
  position: relative;
}

.pat-answer input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pat-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--fella-separator);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--fella-primary-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.pat-option:hover {
  background: var(--fella-secondary-fill);
}

.pat-option:focus-visible {
  outline: 2px solid var(--fella-accent);
  outline-offset: 2px;
}

.pat-answer input:checked + .pat-option {
  border-color: rgba(0, 0, 0, 0.8);
  background: var(--fella-secondary-fill);
}

.pat-answer input:focus-visible + .pat-option {
  outline: 2px solid var(--fella-accent);
  outline-offset: 2px;
}

.pat-radio {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--fella-separator);
  border-radius: var(--radius-pill);
  background: #ffffff;
  position: relative;
}

.pat-answer input:checked + .pat-option .pat-radio {
  border-color: rgba(0, 0, 0, 0.8);
}

.pat-answer input:checked + .pat-option .pat-radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.8);
  transform: translate(-50%, -50%);
}

.pat-hint {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--fella-destructive);
  font-size: 14px;
  line-height: 1.4;
}

.pat-hint:empty {
  display: none;
}

/* Controls */
.pat-controls {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.pat-controls .button {
  flex: 1;
  min-height: 44px;
}

.pat-controls .button:disabled {
  opacity: 0.45;
}

.pat-controls .button-secondary {
  background: transparent;
  border: 1px solid var(--fella-primary-text);
  color: var(--fella-primary-text);
  font-weight: 500;
  font-size: 15px;
}

.pat-controls .button-primary {
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-weight: 500;
  font-size: 15px;
}

/* Result */
.pat-result {
  text-align: left;
}

.pat-result-header {
  margin-bottom: 20px;
}

.pat-eyebrow {
  margin: 0 0 8px;
  color: var(--fella-secondary-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pat-score {
  margin: 0;
  color: var(--fella-primary-text);
  font-size: clamp(36px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.pat-score small {
  color: var(--fella-secondary-text);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0;
}

.pat-band {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--fella-secondary-fill);
  color: var(--fella-primary-text);
  font-size: 15px;
  font-weight: 600;
}

.pat-result-copy {
  margin: 0;
  color: var(--fella-primary-text);
  font-size: 17px;
  line-height: 1.55;
}

.pat-result-copy + .pat-result-copy {
  margin-top: 12px;
}

.pat-steps {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.pat-steps li {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--fella-separator);
  color: var(--fella-primary-text);
  font-size: 16px;
  line-height: 1.45;
}

.pat-steps li:last-child {
  border-bottom: 1px solid var(--fella-separator);
}

.pat-step-num {
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--fella-primary-text);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pat-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.pat-result-actions .button {
  flex: 1 1 160px;
}

.pat-result-note {
  margin: 16px 0 0;
  color: var(--fella-secondary-text);
  font-size: 13px;
  line-height: 1.45;
}

.pat-fallback {
  margin: 0;
  color: var(--fella-primary-text);
  text-align: center;
  font-size: 15px;
}

/* Reuse planner's FAQ/result typography */
.pat-page.seo-design-template .vs-compare-wrap {
  max-width: 100%;
}

@media (max-width: 767px) {
  .pat-page.seo-design-template .how-hero.pat-hero {
    padding: 48px 0 32px;
  }

  .pat-page.seo-design-template .pat-hero .text-card h1 {
    font-size: 34px;
  }

  .pat-h1-payoff {
    margin-top: 6px;
    font-size: 24px;
  }

  .pat-tool {
    margin-top: 28px;
  }

  .pat-card {
    padding: 20px 16px;
  }

  .pat-controls {
    flex-direction: column;
  }

  .pat-controls .button {
    width: 100%;
  }

  .pat-result-actions {
    flex-direction: column;
  }

  .pat-result-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pat-progress-fill,
  .pat-option {
    transition: none;
  }
}

/* Hold the tool's rendered height until its script replaces the no-JS note,
   so the sections below do not jump when the tool appears (layout shift). */
@media (scripting: enabled) {
  [data-pat]:has([data-pat-fallback]) {
    min-height: 500px;
  }

  @media (min-width: 768px) {
    [data-pat]:has([data-pat-fallback]) {
      min-height: 439px;
    }
  }
}
