/* replacemysocialsecuritycard.com — calm, editorial, accessible static site
   Independent informational website. Not affiliated with the SSA. */

:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eef1f5;
  --text: #1a1f2c;
  --text-muted: #4a5468;
  --border: #d8dde5;
  --primary: #1f4e8a;          /* calm navy — trustworthy, not government blue */
  --primary-dark: #163a68;
  --primary-tint: #e6edf6;
  --accent: #0a7c64;            /* deep teal for confirmations */
  --warn-bg: #fff7e1;
  --warn-border: #e0b94a;
  --warn-text: #5c4400;
  --alert-bg: #fdecec;
  --alert-border: #d04848;
  --alert-text: #6b1a1a;
  --focus: #ffb515;
  --max: 760px;
  --max-wide: 1040px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 50, 0.06), 0 4px 12px rgba(20, 30, 50, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #161a23;
    --surface-2: #1e2330;
    --text: #eef1f6;
    --text-muted: #b5bdcc;
    --border: #2a3142;
    --primary: #7faedf;
    --primary-dark: #a7c4e6;
    --primary-tint: #1a2a40;
    --accent: #5fd1b4;
    --warn-bg: #3a2f12;
    --warn-border: #c79a2d;
    --warn-text: #f3dc94;
    --alert-bg: #3a1818;
    --alert-border: #d04848;
    --alert-text: #f7c1c1;
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.125rem;      /* 18px base — readable for older users */
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--primary-dark); }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--text);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* Disclaimer bar */
.disclaimer-bar {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-bottom: 1px solid var(--warn-border);
  font-size: 0.95rem;
  padding: 0.55rem 1rem;
  text-align: center;
  line-height: 1.4;
}
.disclaimer-bar strong { font-weight: 700; }

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand span { color: var(--primary); }
.brand small {
  display: block;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0;
  margin-top: 1px;
}

/* Nav */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    flex-basis: 100%;
    display: none;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0.25rem; padding-top: 0.5rem; }
  .site-nav a {
    display: block;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
  }
}

/* Layout */
main { display: block; }
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.container-wide { max-width: var(--max-wide); }

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0;
}
.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: 0.35rem;
  color: var(--border);
}

/* Typography */
h1, h2, h3, h4 {
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
}
h1 {
  font-size: 2rem;
  margin: 0.25rem 0 1rem;
}
h2 {
  font-size: 1.45rem;
  margin: 2.25rem 0 0.85rem;
  padding-top: 0.25rem;
}
h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}
p { margin: 0 0 1rem; }

.lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

ul, ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }
li { margin-bottom: 0.4rem; }

.meta-line {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

/* Direct-answer box */
.answer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0 1.75rem;
  box-shadow: var(--shadow);
}
.answer-box p:last-child { margin-bottom: 0; }
.answer-box h2, .answer-box h3 { margin-top: 0; }

/* Callout cards */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
}
.callout-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-text);
}
.callout-alert {
  background: var(--alert-bg);
  border-color: var(--alert-border);
  color: var(--alert-text);
}
.callout h3 { margin-top: 0; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
  padding: 0.85rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.05rem;
  border: 1px solid var(--primary);
  min-height: 48px;
  line-height: 1.2;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn:focus-visible { outline-offset: 3px; }
.btn-outline {
  background: transparent;
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary-tint); color: var(--primary-dark); }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 1.75rem;
}

/* Step list */
ol.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 1rem 1rem 1rem 3.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.85rem;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0.9rem;
  top: 0.9rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
ol.steps h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
ol.steps p:last-child { margin-bottom: 0; }

/* Checklist */
ul.checklist { list-style: none; padding: 0; }
ul.checklist > li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.85rem;
  border-bottom: 1px solid var(--border);
}
ul.checklist > li:last-child { border-bottom: none; }
ul.checklist > li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.55rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
}

/* Card grid */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  margin: 1rem 0 1.5rem;
}
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: block;
}
.card:hover { border-color: var(--primary); color: var(--text); }
.card h3 {
  margin: 0 0 0.35rem;
  color: var(--primary);
  font-size: 1.1rem;
}
.card p { color: var(--text-muted); margin: 0; font-size: 1rem; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0 1.5rem;
  font-size: 1rem;
}
th, td {
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { background: var(--surface-2); font-weight: 600; }

/* FAQ */
details.faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  margin-bottom: 0.6rem;
  background: var(--surface);
}
details.faq > summary {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--primary);
  font-weight: 400;
}
details.faq[open] > summary::after { content: "−"; }
details.faq > .faq-body {
  padding: 0 1.25rem 1rem;
  color: var(--text);
}
details.faq > .faq-body p:last-child { margin-bottom: 0; }

/* Sources */
.sources {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.98rem;
  color: var(--text-muted);
}
.sources h2 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.sources ul { padding-left: 1.2rem; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 1.25rem 2.5rem;
  color: var(--text-muted);
  font-size: 0.97rem;
}
.site-footer .inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .site-footer .inner { grid-template-columns: 2fr 1fr 1fr; }
}
.site-footer h4 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin: 0 0 0.5rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.site-footer .disclaimer {
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.site-footer .copyright {
  margin-top: 1rem;
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  grid-column: 1 / -1;
  text-align: center;
}

/* Utility */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

@media (min-width: 720px) {
  h1 { font-size: 2.35rem; }
  body { font-size: 1.15rem; }
}
