/* ──────────────────────────────────────────────────
   Health Planner — Clean Room Dashboard
   Colors & type spec from Claude Design handoff.
   ────────────────────────────────────────────────── */

/* ── Base ─────────────────────────────────────────── */
.hp-body {
  margin: 0;
  padding: 0;
  background: #F7F6F2;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
}

/* Critical: prevent display:flex from overriding [hidden] */
.hp-root[hidden],
.hp-onboarding[hidden] { display: none !important; }

/* ── Root container ───────────────────────────────── */
.hp-root {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* ── Header ──────────────────────────────────────── */
.hp-header {
  padding: 48px 24px 18px;
}

.hp-date {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 400;
  color: #8A8A8A;
  letter-spacing: 0.1px;
}

.hp-headline {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 500;
  color: #1A1A1A;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

/* ── Completion counter ───────────────────────────── */
.hp-progress {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 500;
  color: #8A8A8A;
  letter-spacing: 0.1px;
  min-height: 16px;
}
.hp-progress--complete {
  color: #5A8A6A;
  font-weight: 600;
}

.hp-rule {
  border: none;
  border-top: 1px solid rgba(26,26,26,0.08);
  margin: 0;
}

/* ── Cards ───────────────────────────────────────── */
.hp-cards {
  flex: 1;
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hp-card {
  background: #FFFFFF;
  border-radius: 16px;
  border-top: 3px solid transparent;
  padding: 18px 20px 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 220ms ease, box-shadow 220ms ease, transform 100ms ease;
  position: relative;
}

.hp-card[data-card="move"] { border-top-color: #4A6FA5; }
.hp-card[data-card="eat"]  { border-top-color: #5A8A6A; }
.hp-card[data-card="live"] { border-top-color: #B5654A; }

.hp-card:active { transform: scale(0.985); }

.hp-card:focus-visible {
  outline: 2px solid #4A6FA5;
  outline-offset: 2px;
}

.hp-card[data-card="move"].is-done { background: #EEF2F9; box-shadow: none; }
.hp-card[data-card="eat"].is-done  { background: #EEF7EE; box-shadow: none; }
.hp-card[data-card="live"].is-done { background: #FDF0EC; box-shadow: none; }

/* ── Checkmark ────────────────────────────────────── */
.hp-check {
  display: none;
  position: absolute;
  top: 14px;
  right: 16px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.hp-card[data-card="move"].is-done .hp-check { display: flex; background: #4A6FA5; }
.hp-card[data-card="eat"].is-done  .hp-check { display: flex; background: #5A8A6A; }
.hp-card[data-card="live"].is-done .hp-check { display: flex; background: #B5654A; }

/* ── Pillar label ────────────────────────────────── */
.hp-pillar {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--pillar-color);
  line-height: 1;
}

/* ── Action text ─────────────────────────────────── */
.hp-action {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.6px;
  color: #1A1A1A;
  transition: opacity 220ms ease;
}

.hp-card.is-done .hp-action {
  opacity: 0.42;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(26,26,26,0.5);
}

/* ── Card footer row ─────────────────────────────── */
.hp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

/* ── Progress dots ───────────────────────────────── */
.hp-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: opacity 220ms ease;
}

.hp-dot--empty {
  background: transparent;
  border: 1px solid rgba(26,26,26,0.18);
}

.hp-card.is-done .hp-dot {
  opacity: 0.4;
}

/* ── Tap hint ─────────────────────────────────────── */
.hp-tap-hint {
  font-size: 10px;
  color: rgba(26,26,26,0.28);
  letter-spacing: 0.1px;
  flex-shrink: 0;
  white-space: nowrap;
}
.hp-card.is-done .hp-tap-hint { display: none; }

/* ── Subtext ─────────────────────────────────────── */
.hp-subtext {
  font-size: 12px;
  font-weight: 400;
  color: #8A8A8A;
  letter-spacing: -0.1px;
  transition: opacity 220ms ease;
  white-space: nowrap;
}

.hp-card.is-done .hp-subtext {
  opacity: 0.6;
}

/* ── Footer ──────────────────────────────────────── */
.hp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 40px;
}

.hp-why-link {
  background: rgba(74,111,165,0.09);
  border: 1px solid rgba(74,111,165,0.22);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #4A6FA5;
  text-decoration: none;
  letter-spacing: -0.1px;
  cursor: pointer;
  transition: background 150ms ease;
}
.hp-why-link:hover { background: rgba(74,111,165,0.16); }

.hp-gear-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8A8A8A;
}

/* ── Scrim ───────────────────────────────────────── */
.hp-scrim {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.18);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.hp-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Drawer ──────────────────────────────────────── */
.hp-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  height: 64%;
  background: #FFFFFF;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.10);
  padding: 14px 24px 36px;
  display: flex;
  flex-direction: column;
  z-index: 101;
  transform: translateY(110%);
  transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.hp-drawer.is-open {
  transform: translateY(0);
}

.hp-drawer-grabber {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(26,26,26,0.12);
  margin: 0 auto 8px;
  flex-shrink: 0;
}

.hp-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.hp-drawer-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #8A8A8A;
}

.hp-drawer-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: #1A1A1A;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.hp-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(26,26,26,0.05);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 150ms ease;
}

.hp-drawer-close:hover {
  background: rgba(26,26,26,0.10);
}

/* ── Score rows ──────────────────────────────────── */
.hp-scores {
  display: flex;
  flex-direction: column;
  gap: 22px;
  flex: 1;
  overflow-y: auto;
}

.hp-score-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hp-score-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.hp-score-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.hp-score-label {
  font-size: 15px;
  font-weight: 500;
  color: #1A1A1A;
  letter-spacing: -0.2px;
}

.hp-score-num {
  font-size: 13px;
  font-weight: 500;
  color: #1A1A1A;
  font-variant-numeric: tabular-nums;
}

.hp-score-denom {
  color: #8A8A8A;
  font-weight: 400;
}

/* ── Urgency bar ─────────────────────────────────── */
.hp-bar-track {
  position: relative;
  height: 3px;
  background: rgba(26,26,26,0.06);
  border-radius: 2px;
}

.hp-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 2px;
}

.hp-bar-alt {
  position: absolute;
  top: -3px;
  width: 1.5px;
  height: 9px;
  background: rgba(26,26,26,0.35);
}

.hp-score-alt {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: #8A8A8A;
  letter-spacing: -0.05px;
}

.hp-score-alt strong {
  color: rgba(26,26,26,0.7);
  font-weight: 400;
}

/* ── Drawer footnote ─────────────────────────────── */
.hp-drawer-footnote {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(26,26,26,0.08);
  font-size: 11px;
  font-weight: 400;
  color: #8A8A8A;
  letter-spacing: 0.1px;
  text-align: center;
  flex-shrink: 0;
}

.hp-reset-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  color: #4A6FA5;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════
   ONBOARDING
   ════════════════════════════════════════════════════ */

.hp-onboarding {
  min-height: 100svh;
  background: #F7F6F2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 0 40px;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hp-ob-inner {
  width: 100%;
  max-width: 480px;
  padding: 52px 24px 0;
}

/* ── Onboarding header ────────────────────────────── */
.hp-ob-header {
  margin-bottom: 36px;
}

.hp-ob-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #4A6FA5;
}

.hp-ob-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  color: #1A1A1A;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.hp-ob-sub {
  margin: 0;
  font-size: 13px;
  color: #8A8A8A;
}

/* ── Form rows ────────────────────────────────────── */
.hp-ob-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hp-ob-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hp-ob-row--half {
  flex-direction: row;
  gap: 12px;
}

.hp-ob-row--half > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hp-ob-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #1A1A1A;
  display: block;
}

.hp-ob-opt {
  font-weight: 400;
  color: #8A8A8A;
}

/* ── Inputs ───────────────────────────────────────── */
.hp-ob-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: #FFFFFF;
  border: 1px solid rgba(26,26,26,0.12);
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  color: #1A1A1A;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 150ms ease, box-shadow 150ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.hp-ob-input:focus {
  outline: none;
  border-color: #4A6FA5;
  box-shadow: 0 0 0 3px rgba(74,111,165,0.12);
}

.hp-ob-select {
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238A8A8A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Segment controls (sex, goal) ─────────────────── */
.hp-ob-segs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hp-ob-segs--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.hp-ob-seg {
  height: 44px;
  background: #FFFFFF;
  border: 1px solid rgba(26,26,26,0.12);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1A1A1A;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
  white-space: nowrap;
  padding: 0 8px;
}

.hp-ob-seg.is-active {
  background: #4A6FA5;
  border-color: #4A6FA5;
  color: #FFFFFF;
}

/* ── Error message ────────────────────────────────── */
.hp-ob-error {
  margin: 0;
  font-size: 13px;
  color: #B5654A;
  font-weight: 500;
}

/* ── Submit button ────────────────────────────────── */
.hp-ob-submit {
  height: 52px;
  background: #1A1A1A;
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
  margin-top: 4px;
}

.hp-ob-submit:hover  { background: #333333; }
.hp-ob-submit:active { transform: scale(0.98); }

/* ── Data conflict modal ──────────────────────────────────── */
.hp-conflict-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26,26,26,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.hp-conflict-modal[hidden] { display: none !important; }

.hp-conflict-inner {
  background: #F7F6F2;
  border-radius: 20px;
  padding: 36px 28px;
  max-width: 420px;
  width: 100%;
}

.hp-conflict-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.hp-conflict-secondary {
  height: 48px;
  background: transparent;
  border: 1px solid rgba(26,26,26,0.15);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #1A1A1A;
  cursor: pointer;
  transition: background 150ms ease;
}
.hp-conflict-secondary:hover { background: rgba(26,26,26,0.05); }
