/* SeniorAnswerDesk — style.css — updated to match index.html design system */

:root {
  --paper:       #FAF5EB;
  --card:        #FFFCF4;
  --ink:         #28352E;
  --ink-soft:    #51625A;
  --line:        #2F3D35;
  --green:       #1D9E75;
  --green-deep:  #0E5038;
  --green-tint:  #E2F1E9;
  --amber:       #B97F18;
  --amber-tint:  #FBEFD4;
  --alert-red:   #A93B2E;
  --alert-tint:  #F8E2DC;
  --display:     "Fraunces", Georgia, "Times New Roman", serif;
  --body:        "Atkinson Hyperlegible", "Segoe UI", Verdana, sans-serif;

  /* Legacy aliases used by JS-generated HTML */
  --green-dark:  #0E5038;
  --green-light: #E2F1E9;
  --text:        #28352E;
  --muted:       #51625A;
  --border:      #C5BBA8;
  --bg:          #FAF5EB;
  --white:       #FFFCF4;
  --radius:      14px;
  --shadow:      5px 5px 0 var(--line);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 19px; }

body {
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.65;
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(29,158,117,0.06), transparent 55%),
    radial-gradient(ellipse at 110% 30%, rgba(185,127,24,0.05), transparent 45%);
}

a { color: var(--green-deep); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Layout ── */
#app {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── Header ── */
header.site-ask {
  border-bottom: 2px solid var(--line);
  background: var(--paper);
  margin-bottom: 32px;
}
.ask-bar {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-bell {
  width: 46px; height: 46px; flex: none;
  background: var(--green);
  border: 2px solid var(--line);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--line);
  display: grid;
  place-items: center;
}
.brand-name-ask {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand-name-ask small {
  display: block;
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── Scam tip bar ── */
.scam-tip-bar {
  background: var(--amber-tint);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 28px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink);
}

.scam-tip-label {
  font-weight: 700;
  margin-right: 6px;
  white-space: nowrap;
  color: var(--amber);
}

/* ── Progress bar ── */
#progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

#progress-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid rgba(47,61,53,0.3);
}

#progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 99px;
  transition: width 0.35s ease;
  width: 0%;
}

#progress-label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  white-space: nowrap;
  font-family: var(--display);
  font-style: italic;
}

/* ── Screen cards ── */
.screen {
  display: none;
  animation: fadeIn 0.25s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Welcome screen ── */
#screen-welcome .welcome-box {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 36px 32px 32px;
  text-align: center;
}

#screen-welcome h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.9rem;
  color: var(--green-deep);
  margin-bottom: 14px;
  line-height: 1.15;
}

#screen-welcome .welcome-copy {
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 28px;
  line-height: 1.7;
}

.trust-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
  text-align: left;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.trust-list li {
  font-size: 0.92rem;
  color: var(--ink-soft);
  padding-left: 28px;
  position: relative;
}

.trust-list li::before {
  content: "✓";
  color: var(--green);
  position: absolute;
  left: 0;
  font-weight: 700;
  font-size: 1rem;
}

/* ── Question screens ── */
.question-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px 28px;
}

.compassion-note {
  background: var(--green-tint);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 0.95rem;
  color: var(--green-deep);
  margin-bottom: 22px;
  line-height: 1.6;
}

.question-label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  color: var(--ink);
  margin-bottom: 22px;
  line-height: 1.4;
}

/* ── Choice buttons ── */
.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-btn {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--line);
  padding: 16px 20px;
  font-size: 1.05rem;
  font-family: var(--body);
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, transform 0.12s, box-shadow 0.12s;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

.choice-btn:hover,
.choice-btn:focus {
  background: var(--green-tint);
  outline: none;
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

.choice-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

/* ── Topic picker ── */
#screen-topics .topic-intro {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 22px;
}

.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.topic-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--line);
  padding: 20px 16px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, transform 0.12s, box-shadow 0.12s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.topic-card:hover,
.topic-card:focus {
  background: var(--green-tint);
  outline: none;
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--line);
}

.topic-card .topic-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.topic-card .topic-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.3;
}

.topic-card .badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--green);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1.5px solid var(--line);
}

/* ── Topic follow-up questions ── */
#screen-topic-questions .question-card {
  margin-bottom: 16px;
}

/* ── Primary button ── */
.btn-primary {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--line);
  padding: 16px 36px;
  font-size: 1.1rem;
  font-family: var(--body);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.12s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  background: var(--green-deep);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--line);
}
.btn-primary:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--line);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.92rem;
  cursor: pointer;
  padding: 10px 0;
  font-family: var(--body);
  text-decoration: underline;
  -webkit-tap-highlight-color: transparent;
}
.btn-back:hover { color: var(--ink); }

.btn-restart {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 10px 0;
  font-family: var(--body);
  text-decoration: underline;
  -webkit-tap-highlight-color: transparent;
}
.btn-restart:hover { color: var(--ink); }

/* ── Open text fallback ── */
.btn-open-fallback {
  display: block;
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 10px 0 4px;
  font-family: var(--body);
  text-decoration: underline;
  text-align: left;
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
}
.btn-open-fallback:hover { color: var(--ink); }

.open-fallback-box {
  margin-top: 16px;
  padding: 18px 20px;
  background: var(--green-tint);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
}

.open-fallback-label {
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.5;
}

.open-fallback-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  resize: vertical;
  line-height: 1.5;
  margin-bottom: 12px;
}
.open-fallback-textarea:focus {
  outline: none;
  border-color: var(--green);
}

.open-fallback-submit {
  width: 100%;
}

/* ── Loading spinner ── */
#screen-loading {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--green-tint);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

#screen-loading p {
  font-size: 1rem;
  color: var(--ink-soft);
  font-family: var(--display);
  font-style: italic;
}

/* ── Utility ── */
.center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ── Name input ── */
.name-input {
  display: block;
  width: 100%;
  padding: 16px 18px;
  font-size: 1.1rem;
  font-family: var(--body);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  margin-top: 4px;
}
.name-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-tint);
}

.skip-link {
  display: block;
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  text-decoration: underline;
  cursor: pointer;
  text-align: center;
}
.skip-link:hover { color: var(--ink); }

/* ── Answer page (full-screen takeover) ── */
#answer-page {
  background: var(--paper);
  min-height: 100vh;
  font-family: var(--body);
  color: var(--ink);
  line-height: 1.7;
  background-image:
    radial-gradient(ellipse at 20% -10%, rgba(29,158,117,0.06), transparent 55%),
    radial-gradient(ellipse at 110% 30%, rgba(185,127,24,0.05), transparent 45%);
}

.ap-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: var(--paper);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ap-logo {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-deep);
  letter-spacing: -0.3px;
}

.ap-topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.ap-btn-outline {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 2px 2px 0 var(--line);
  padding: 8px 16px;
  font-size: 0.9rem;
  font-family: var(--body);
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.12s;
}
.ap-btn-outline:hover {
  background: var(--green-tint);
  color: var(--green-deep);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--line);
}

.ap-btn-help {
  background: var(--green);
  color: #fff;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--line);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-family: var(--body);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.12s;
}
.ap-btn-help:hover {
  background: var(--green-deep);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--line);
}

/* Hero banner */
.ap-hero {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
}

.ap-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.ap-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(14,80,56,0.65) 0%, rgba(14,80,56,0.2) 60%, transparent 100%);
  z-index: 1;
}

.ap-hero-overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
  width: 100%;
}

.ap-hero-label {
  font-family: var(--body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 14px;
}

.ap-hero-heading {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.15;
  max-width: 780px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Welcome body */
.ap-welcome {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 48px 40px;
}

.ap-welcome-text p {
  margin-bottom: 16px;
  font-size: 1.05rem;
  color: var(--ink);
}

.ap-welcome-photo {
  border-radius: 14px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--green);
}

.ap-welcome-photo img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 35%;
  border-radius: 12px;
  display: block;
}

.ap-img-label {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-top: 10px;
  text-align: center;
  color: var(--ink-soft);
}

/* Summary block */
.ap-summary {
  max-width: 780px;
  margin: 0 auto 48px;
  padding: 22px 32px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ap-summary p {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--ink);
  margin: 0;
}

/* Article cards */
.ap-cards {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 16px;
}

.article-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  margin-bottom: 72px;
}

.article-card-reverse .card-image { order: 2; }
.article-card-reverse .card-text  { order: 1; }

.card-image {
  border-radius: 14px;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  box-shadow: 5px 5px 0 var(--line);
}

.card-image img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center 35%;
  display: block;
  border-radius: 12px;
}

.card-img-label {
  font-family: var(--display);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 10px;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
}

.card-text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card-tag {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: fit-content;
  border: 1.5px solid currentColor;
}

.card-headline {
  font-family: var(--display);
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--ink);
  margin: 0;
  font-weight: 600;
}

.card-summary {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 0;
}

.card-link {
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}
.card-link:hover { opacity: 0.75; text-decoration: underline; }

/* Resource card */
.ap-resource-card {
  max-width: 780px;
  margin: 0 auto 48px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 36px;
}

.ap-resource-card h2 {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--green-deep);
  margin-bottom: 20px;
  font-weight: 600;
}

.ap-resource-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ap-resource-item a {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1.5px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: color 0.12s;
}
.ap-resource-item:last-child a { border-bottom: none; }
.ap-resource-item a:hover .ap-resource-name { text-decoration: underline; color: var(--green-deep); }

.ap-resource-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.ap-resource-desc {
  font-size: 0.88rem;
  color: var(--ink-soft);
  grid-column: 1;
  margin-top: 2px;
}

.ap-resource-arrow {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
  grid-row: 1;
  grid-column: 3;
  align-self: center;
}

/* Disclaimer */
.ap-disclaimer {
  max-width: 780px;
  margin: 0 auto 40px;
  padding: 0 32px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Bottom bar */
.ap-bottombar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: var(--green-deep);
  border-top: 2px solid var(--line);
  margin-top: 16px;
}

.ap-btn-back {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  font-size: 1rem;
  font-family: var(--body);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.ap-btn-back:hover { color: #fff; }

/* ── Mobile ── */
@media (max-width: 500px) {
  html { font-size: 17px; }
  #screen-welcome .welcome-box { padding: 28px 20px 24px; }
  .question-card { padding: 24px 18px; }
  .topic-grid { grid-template-columns: 1fr; }
  .btn-primary { width: 100%; padding: 18px 20px; }
}

@media (max-width: 720px) {
  .ap-topbar { padding: 12px 16px; }
  .ap-topbar-actions { gap: 6px; }
  .ap-btn-outline { padding: 7px 10px; font-size: 0.82rem; }
  .ap-btn-help { padding: 8px 14px; font-size: 0.88rem; }

  .ap-hero { height: 220px; }
  .ap-hero-overlay { padding: 0 24px; }
  .ap-hero-heading { font-size: 1.55rem; }

  .ap-welcome {
    grid-template-columns: 1fr;
    padding: 28px 20px;
    gap: 24px;
  }
  .ap-welcome-photo { min-height: 180px; }
  .ap-welcome-photo img { height: 180px; }

  .ap-summary { margin: 0 16px 36px; padding: 18px 20px; }

  .ap-cards { padding: 0 16px; }

  .article-card {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 48px;
  }
  .article-card-reverse .card-image { order: 0; }
  .article-card-reverse .card-text  { order: 1; }

  .card-image { min-height: 200px; }
  .card-image img { height: 200px; }

  .ap-resource-card { margin: 0 16px 36px; padding: 24px 20px; }
  .ap-resource-item a { grid-template-columns: 1fr auto; }

  .ap-bottombar { padding: 20px 16px; }
  .ap-disclaimer { padding: 0 16px; }
}
