/* Password Habit Quiz
   Scoped to this page. Uses the site obsidian tokens from css/style.css. */

.ph-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4.5rem;
  color: var(--text);
}

.ph-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0.5rem 0 1.25rem;
  font-size: 0.85rem;
  color: var(--text-faint);
}

.ph-crumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.ph-crumb a:hover {
  color: var(--primary-soft);
}

.ph-hero {
  position: static;
  top: auto;
  z-index: auto;
  max-width: 42rem;
  margin-bottom: 1.25rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.ph-badge {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--primary-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ph-hero h1,
.ph-prose h2,
.ph-faq h2,
.ph-related h2,
.ph-prompt,
.ph-score-heading {
  margin: 0 0 0.45rem;
  font-family: var(--font-brand), Georgia, serif;
  font-weight: 600;
}

.ph-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.ph-hero p,
.ph-prose p,
.ph-faq p,
.ph-hint,
.ph-detail,
.ph-summary,
.ph-share,
.ph-checker,
.ph-block {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.ph-hero p {
  margin: 0 0 0.9rem;
}

.ph-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ph-steps li {
  margin: 0;
  padding: 0.75rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.ph-steps strong {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text);
}

.ph-client {
  margin: 1.25rem 0 2rem;
}

.ph-status {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 1rem;
  margin-bottom: 0.75rem;
}

.ph-status p,
.ph-recall p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

#ph-progress,
#ph-saved {
  color: var(--text);
  font-weight: 650;
}

#ph-saved {
  text-align: right;
}

.ph-meter {
  grid-column: 1 / -1;
  height: 6px;
  margin-top: 0.35rem;
  overflow: hidden;
  background: var(--bg-elevated);
  border-radius: 999px;
}

.ph-meter-fill {
  width: 0;
  height: 100%;
  background: var(--primary);
  transition: width 160ms ease;
}

.ph-recall {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.8rem;
  padding: 0.8rem 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.ph-recall[hidden] {
  display: none;
}

.ph-recall-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ph-card {
  min-height: 280px;
  padding: 1.25rem 1.2rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.ph-card.is-fresh {
  animation: ph-in 180ms ease;
}

.ph-kicker,
.ph-action-kicker {
  margin: 0 0 0.45rem;
  color: var(--primary-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ph-prompt,
.ph-score-heading {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.ph-fieldset {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ph-detail {
  margin: 0 0 0.9rem;
}

.ph-choices {
  display: grid;
  gap: 0.55rem;
}

.ph-choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  min-height: 56px;
  padding: 0.75rem 0.85rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  cursor: pointer;
}

.ph-choice input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--primary, #c2410c);
}

.ph-choice-text {
  line-height: 1.4;
}

.ph-choice-key {
  color: var(--text-faint);
  font-size: 0.78rem;
  font-weight: 700;
}

.ph-choice:has(input:checked) {
  border-color: var(--primary-soft);
  box-shadow: inset 4px 0 0 var(--primary);
}

.ph-choice:focus-within {
  outline: 2px solid var(--primary-soft);
  outline-offset: 3px;
}

.ph-actions,
.ph-score-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
}

.ph-actions .ph-next:only-child,
.ph-score-actions .ph-clear {
  grid-column: 1 / -1;
}

.ph-next,
.ph-back,
.ph-copy,
.ph-again,
.ph-clear,
.ph-recall-actions button {
  min-height: 52px;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.ph-next,
.ph-again,
.ph-recall-actions [data-action='saved'] {
  color: var(--primary-ink);
  background: var(--primary);
  border: 1px solid transparent;
}

.ph-back,
.ph-copy,
.ph-clear,
.ph-recall-actions [data-action='clear'] {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
}

.ph-next:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ph-next:hover,
.ph-back:hover,
.ph-copy:hover,
.ph-again:hover,
.ph-clear:hover,
.ph-recall-actions button:hover,
.ph-choice:hover {
  border-color: var(--primary-soft);
}

.ph-score-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.ph-ring {
  --ph-pct: 0;
  display: grid;
  place-items: center;
  width: 6.5rem;
  height: 6.5rem;
  background: conic-gradient(var(--primary) calc(var(--ph-pct) * 1%), var(--bg-elevated) 0);
  border-radius: 50%;
}

.ph-ring-value {
  display: grid;
  place-items: center;
  width: 4.7rem;
  height: 4.7rem;
  color: var(--text);
  font-family: var(--font-brand), Georgia, serif;
  font-size: 1.7rem;
  background: var(--card);
  border-radius: 50%;
}

.ph-score-num {
  margin: 0.15rem 0 0.35rem;
  color: var(--text);
  font-weight: 650;
}

.ph-summary,
.ph-share,
.ph-checker,
.ph-copy-status {
  margin: 0.35rem 0 0;
}

.ph-pips {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.2rem 0 1.1rem;
  padding: 0;
  list-style: none;
}

.ph-pips li {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
}

.ph-pip {
  display: block;
  height: 6px;
  margin-bottom: 0.25rem;
  background: var(--bg-elevated);
  border-radius: 999px;
}

.ph-pips .is-strong .ph-pip {
  background: #86efac;
}

.ph-pips .is-ok .ph-pip {
  background: #fde68a;
}

.ph-pips .is-weak .ph-pip {
  background: #fdba74;
}

.ph-pips .is-gap .ph-pip {
  background: #fecaca;
}

.ph-plan-heading,
.ph-action-title {
  margin: 0.9rem 0 0.45rem;
  font-family: var(--font-brand), Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.ph-action-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
}

.ph-leads,
.ph-more {
  display: grid;
  gap: 0.7rem;
}

.ph-action {
  padding: 0.9rem 0.95rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.ph-action.is-lead {
  border-color: var(--border-strong);
}

.ph-block {
  margin: 0.45rem 0 0;
}

.ph-block-label {
  display: block;
  margin-bottom: 0.1rem;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ph-share {
  padding: 0.75rem 0.8rem;
  overflow-wrap: anywhere;
  background: var(--bg-elevated);
  border-radius: 12px;
}

.ph-checker a,
.ph-prose a,
.ph-faq a {
  color: var(--primary-soft);
}

.ph-copy-status {
  min-height: 1.2em;
  color: var(--text);
  font-weight: 650;
}

.ph-choice:focus-within,
.ph-next:focus-visible,
.ph-back:focus-visible,
.ph-copy:focus-visible,
.ph-again:focus-visible,
.ph-clear:focus-visible,
.ph-recall-actions button:focus-visible,
.ph-prompt:focus-visible,
.ph-score-heading:focus-visible {
  outline: 2px solid var(--primary-soft);
  outline-offset: 3px;
}

.ph-prose,
.ph-faq,
.ph-related {
  max-width: 42rem;
  margin: 2rem 0;
}

.ph-prose h3 {
  margin: 1.4rem 0 0.4rem;
  font-family: var(--font-brand), Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
}

.ph-faq details {
  border-top: 1px solid var(--border);
}

.ph-faq summary {
  padding: 0.85rem 0;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
}

.ph-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.ph-related-grid a {
  display: block;
  padding: 0.9rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.ph-related-grid a:hover {
  border-color: var(--primary-soft);
}

.ph-related-grid strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text);
}

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

@keyframes ph-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 700px) {
  .ph-page {
    padding: 1rem 0.9rem 4rem;
  }

  .ph-steps,
  .ph-related-grid,
  .ph-pips,
  .ph-status,
  .ph-score-row {
    grid-template-columns: 1fr;
  }

  #ph-saved {
    text-align: left;
  }

  .ph-card {
    padding: 1rem 0.9rem;
  }

  .ph-actions,
  .ph-score-actions {
    grid-template-columns: 1fr;
  }

  .ph-choice-key {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ph-card,
  .ph-card.is-fresh,
  .ph-meter-fill,
  .ph-next,
  .ph-back,
  .ph-copy,
  .ph-again,
  .ph-clear,
  .ph-choice {
    animation: none;
    transition: none;
  }
}
