/* ============================================================
   RecoverKY — style.css
   Mobile-first. System fonts only. No external dependencies.
   ============================================================ */

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

/* === Tokens === */
:root {
  --blue:        #1d4ed8;
  --blue-dark:   #1e3a8a;
  --blue-light:  #eff6ff;
  --green:       #15803d;
  --green-light: #f0fdf4;
  --red:         #b91c1c;
  --red-dark:    #7f1d1d;
  --red-light:   #fff1f2;
  --amber:       #b45309;
  --amber-light: #fffbeb;
  --amber-border:#d97706;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-400:    #9ca3af;
  --gray-600:    #4b5563;
  --gray-900:    #111827;
  --text:        #1c1917;
  --tap-min:     52px;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 6px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
}

/* === Base === */
html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

/* === Visually hidden (accessible label for screen readers) === */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Skip link === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--blue-dark);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 999;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}

/* === Header === */
.site-header {
  background: var(--blue-dark);
  color: #fff;
  padding: 0.75rem 1rem;
}

.site-header-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-name:hover { text-decoration: underline; }

/* === Social worker toggle === */
.sw-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sw-toggle-label {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
}

#toggle-sw {
  appearance: none;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  width: 44px;
  height: 24px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
#toggle-sw::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
#toggle-sw[aria-checked="true"] {
  background: #22c55e;
  border-color: #22c55e;
}
#toggle-sw[aria-checked="true"]::after {
  transform: translateX(20px);
}
#toggle-sw:focus {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

/* === SW mode visibility === */
.sw-only   { display: none; }
.client-only { display: block; }

body.sw-mode .sw-only    { display: block; }
body.sw-mode .client-only { display: none; }

.sw-badge {
  display: inline-block;
  background: #22c55e;
  color: #052e16;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.sw-box {
  background: var(--green-light);
  border: 1.5px solid #86efac;
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}
.sw-box h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--green);
  margin-bottom: 0.5rem;
}

/* === Back link === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--blue);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}
.back-link:hover { text-decoration: underline; }
.back-link::before { content: '←'; }

/* === Page title === */
h1 {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--blue-dark);
  margin-bottom: 0.6rem;
}

h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  margin-top: 1.25rem;
}

p {
  margin-bottom: 0.85rem;
}

ul, ol {
  padding-left: 1.4rem;
  margin-bottom: 0.85rem;
}
li { margin-bottom: 0.3rem; }

/* === Homepage entry points === */
.entry-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.entry-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--blue-light);
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue-dark);
  text-decoration: none;
  min-height: var(--tap-min);
  line-height: 1.3;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  box-shadow: var(--shadow);
}
.entry-btn:hover, .entry-btn:focus {
  background: #dbeafe;
  border-color: var(--blue-dark);
  outline: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.entry-btn:active { transform: translateY(0); }

.entry-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}

/* === Question cards === */
.question-card {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.question-card legend,
.question-label {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.85rem;
  display: block;
}

/* Radio / checkbox options */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  cursor: pointer;
  min-height: var(--tap-min);
  transition: border-color 0.15s, background 0.15s;
}
.option-item:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.option-item input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
  flex-shrink: 0;
  cursor: pointer;
}
.option-item label {
  font-size: 1rem;
  cursor: pointer;
  line-height: 1.4;
}

/* === Result sections === */
.result {
  display: none;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
}
.result.visible { display: block; }

.result-exempt {
  background: var(--green-light);
  border: 2px solid #86efac;
}
.result-work {
  background: var(--amber-light);
  border: 2px solid var(--amber-border);
}
.result-active {
  background: var(--blue-light);
  border: 2px solid #93c5fd;
}
.result-pending {
  background: var(--amber-light);
  border: 2px solid var(--amber-border);
}
.result-placeholder {
  background: var(--amber-light);
  border: 2px solid var(--amber-border);
}

.result-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.result h2 {
  margin-top: 0;
  font-size: 1.2rem;
}

/* === Phone CTA === */
.phone-cta {
  background: var(--red);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.phone-cta-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.4rem;
}

.phone-cta-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1.1;
  padding: 0.3rem 0;
}
.phone-cta-number:hover { text-decoration: underline; }

.phone-cta-hours {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* === Inline phone link (in text) === */
.phone-inline {
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
}

/* === Standard buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap-min);
  padding: 0.6rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  line-height: 1.3;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  outline: none;
}

.btn-secondary {
  background: #fff;
  color: var(--blue-dark);
  border-color: var(--blue);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--blue-light);
  outline: none;
}

/* === Date input === */
input[type="date"] {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  min-height: var(--tap-min);
  cursor: pointer;
  margin-top: 0.5rem;
}
input[type="date"]:focus {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
  border-color: var(--blue);
}
.date-hint {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}
.date-error {
  color: var(--red);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.5rem;
}
.date-error:empty {
  display: none;
}

/* === Deadline callout === */
.deadline-callout {
  background: var(--blue-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  text-align: center;
}
.deadline-callout--urgent {
  background: var(--red);
}
.deadline-callout-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}
.deadline-callout-date {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

/* === Info box (neutral informational callout) === */
.info-box {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.info-box strong {
  color: var(--gray-900);
  display: block;
  margin-bottom: 0.3rem;
}

/* === Research placeholder / warning === */
.warning-box {
  background: var(--amber-light);
  border: 2px solid var(--amber-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.warning-box strong {
  color: var(--amber);
  display: block;
  margin-bottom: 0.3rem;
}

/* === kynect link block === */
.kynect-block {
  background: var(--blue-light);
  border: 1.5px solid #93c5fd;
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}
.kynect-block a {
  color: var(--blue-dark);
  font-weight: 600;
}

/* === Divider === */
.divider {
  border: none;
  border-top: 1.5px solid var(--gray-200);
  margin: 1.5rem 0;
}

/* === Step indicator === */
.step-indicator {
  font-size: 0.8rem;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

/* === Checklist === */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.85rem;
}
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.3rem 0;
}
.checklist li::before {
  content: '☐';
  flex-shrink: 0;
  color: var(--green);
  font-size: 1.1rem;
}

/* === Content h3 (sub-sections within result panels) === */
h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.4rem;
  margin-top: 1rem;
}

/* === Footer === */
.site-footer {
  background: var(--gray-100);
  border-top: 1.5px solid var(--gray-200);
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-600);
}
.site-footer a {
  color: var(--blue-dark);
}
.site-footer p + p { margin-top: 0.3rem; }

/* === noscript fallback === */
.noscript-msg {
  background: var(--amber-light);
  border: 2px solid var(--amber-border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* === Redirect card (Branch 3 → Branch 4) === */
.redirect-card {
  background: var(--red-light);
  border: 2px solid #fca5a5;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 1rem;
  display: none;
}
.redirect-card.visible { display: block; }
.redirect-card h2 { color: var(--red); margin-top: 0; }

/* === Responsive (wider screens get a little breathing room) === */
@media (min-width: 480px) {
  h1 { font-size: 1.8rem; }
  .phone-cta-number { font-size: 2.4rem; }
}

@media (min-width: 640px) {
  main { padding: 2rem 1.5rem 3rem; }
  .site-header { padding: 1rem 1.5rem; }
}

/* === Triage CTA (homepage "Not sure where to start?") === */
.triage-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--blue-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  margin-top: 1.25rem;
  box-shadow: var(--shadow-md);
  transition: background 0.15s, transform 0.1s;
  min-height: var(--tap-min);
}
.triage-cta:hover, .triage-cta:focus {
  background: #162f6e;
  outline: none;
  transform: translateY(-1px);
  color: #fff;
}
.triage-cta:active { transform: translateY(0); }
.triage-cta strong {
  display: block;
  font-size: 1rem;
  color: #fff;
}

.triage-cta-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 2rem;
  text-align: center;
}

.triage-cta-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  display: block;
  margin-top: 0.1rem;
}

.triage-cta-arrow {
  margin-left: auto;
  font-size: 1.25rem;
  opacity: 0.7;
  flex-shrink: 0;
}

/* === Entry section label (separates triage CTA from grid) === */
.entry-label {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 1.25rem;
  margin-bottom: 0;
}

/* === Focus visible (keyboard nav) === */
:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}
