/* ==========================================================================
   ClearCare Design System
   Inspired by healthcare.gov — clean, high-contrast, accessible, trustworthy
   Typefaces: Public Sans (headings + body), Source Code Pro (data/mono)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600;700;800&family=Source+Code+Pro:wght@400;600&display=swap');

/* --------------------------------------------------------------------------
   Tokens
-------------------------------------------------------------------------- */
:root {
  /* Brand */
  --navy:       #1a4480;
  --navy-dark:  #162e51;
  --navy-light: #e8f0fb;
  --cyan:       #00bde3;
  --cyan-dark:  #009ec1;

  /* Neutrals — USWDS palette */
  --ink:        #1b1b1b;
  --ink-soft:   #3d4551;
  --ink-faint:  #71767a;
  --border:     #dfe1e2;
  --bg:         #f0f0f0;
  --white:      #ffffff;
  --surface:    #ffffff;

  /* Semantic */
  --success-bg: #ecf3ec; --success-ink: #19511e;
  --warn-bg:    #faf3d1; --warn-ink:    #5c4809;
  --error-bg:   #f4e3db; --error-ink:   #6f3331;
  --info-bg:    #e8f0fb; --info-ink:    #162e51;

  /* Spacing */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
}

/* --------------------------------------------------------------------------
   Reset + Base
-------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, h4 {
  font-family: 'Public Sans', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
p { margin: 0 0 1rem; }
a { color: var(--navy); }
a:hover { color: var(--navy-dark); }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* --------------------------------------------------------------------------
   Header / Nav
-------------------------------------------------------------------------- */
.site-header {
  background: var(--navy-dark);
  border-bottom: 4px solid var(--cyan);
  padding: 0 20px;
}
.site-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.site-logo-mark {
  width: 36px; height: 36px;
  background: var(--cyan);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.site-logo-mark svg { width: 20px; height: 20px; fill: var(--navy-dark); }
.site-logo-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.site-logo-name span { color: var(--cyan); }
.site-logo-tagline {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.site-nav a, .site-nav button {
  color: rgba(255,255,255,0.85);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-md);
  padding: 7px 14px;
  transition: background 0.15s, border-color 0.15s;
}
.site-nav a:hover, .site-nav button:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
.site-nav .nav-name {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  border: none;
  padding: 7px 4px;
}

/* --------------------------------------------------------------------------
   Layout
-------------------------------------------------------------------------- */
.page-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}
.page-wrap.narrow { max-width: 560px; }
.page-wrap.medium { max-width: 720px; }

/* --------------------------------------------------------------------------
   Cards
-------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}
.card + .card { margin-top: 20px; }
@media (max-width: 600px) { .card { padding: 20px 16px; } }

/* --------------------------------------------------------------------------
   Buttons
-------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-md);
  padding: 13px 26px;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  white-space: nowrap;
  min-height: 48px; /* accessibility — minimum tap target */
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-dark); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:disabled { background: #a9aeb1; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-secondary:hover { background: var(--navy-light); color: var(--navy); }
.btn-unstyled {
  background: none; border: none; padding: 0;
  color: var(--navy); font-weight: 600; font-size: inherit;
  text-decoration: underline;
}
.btn-sm { padding: 7px 14px; font-size: 0.875rem; }
.btn-danger { background: none; color: var(--error-ink); border: 1px solid #d54309; }
.btn-danger:hover { background: var(--error-bg); }

/* --------------------------------------------------------------------------
   Forms
-------------------------------------------------------------------------- */
.field { margin-bottom: 22px; }
.field-row { display: grid; gap: 16px; }
.field-row.col2 { grid-template-columns: 1fr 1fr; }
.field-row.col3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 700px) {
  .field-row.col3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .field-row.col2 { grid-template-columns: 1fr; }
}

label.label {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
}
label.label .req { color: #b50909; margin-left: 2px; }
.hint { font-size: 0.825rem; color: var(--ink-faint); margin-top: 5px; }

input[type=text],
input[type=email],
input[type=password],
input[type=date],
input[type=number],
input[type=tel],
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--white);
  border: 2px solid #565c65;
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,68,128,0.2);
}
input.error, select.error { border-color: #b50909; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.checkbox-row:last-child { border-bottom: none; }
.checkbox-row input[type=checkbox] {
  width: 20px; height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--navy);
  border: none;
  padding: 0;
}
.checkbox-row .cb-label { font-size: 0.9375rem; cursor: pointer; }
.checkbox-row .cb-label small {
  display: block;
  color: var(--ink-faint);
  font-size: 0.8rem;
  margin-top: 3px;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Alerts / Notice boxes
-------------------------------------------------------------------------- */
.alert {
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: 0.9rem;
  border-left: 4px solid;
  margin: 16px 0;
}
.alert-success { background: var(--success-bg); color: var(--success-ink); border-color: #4d8055; }
.alert-warn    { background: var(--warn-bg);    color: var(--warn-ink);    border-color: #c2850c; }
.alert-error   { background: var(--error-bg);   color: var(--error-ink);   border-color: #b50909; }
.alert-info    { background: var(--info-bg);    color: var(--info-ink);    border-color: var(--navy); }
.alert strong  { display: block; margin-bottom: 4px; }

/* --------------------------------------------------------------------------
   Step indicator
-------------------------------------------------------------------------- */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  overflow: hidden; /* no scroll */
  flex-wrap: nowrap;
}
.step-item {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--border);
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.step-dot.done { background: var(--navy); color: #fff; }
.step-dot.active { background: var(--navy); color: #fff; box-shadow: 0 0 0 4px rgba(26,68,128,0.2); }
.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin-left: 5px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 80px;
  text-overflow: ellipsis;
}
.step-label.active { color: var(--navy); }
.step-connector {
  flex: 1;
  min-width: 8px;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
}
.step-connector.done { background: var(--navy); }
/* On small screens, hide step labels entirely — just show dots */
@media (max-width: 640px) {
  .step-label { display: none; }
  .step-dot { width: 26px; height: 26px; font-size: 0.72rem; }
}

/* --------------------------------------------------------------------------
   Progress bar
-------------------------------------------------------------------------- */
.progress-bar-wrap {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--navy);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* --------------------------------------------------------------------------
   Application cards (dashboard list)
-------------------------------------------------------------------------- */
.app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
  transition: box-shadow 0.15s;
}
.app-row:hover { box-shadow: var(--shadow-md); }
.app-row-title { font-weight: 700; font-size: 1rem; color: var(--ink); }
.app-row-meta { font-size: 0.825rem; color: var(--ink-faint); margin-top: 3px; }
.app-row-actions { display: flex; align-items: center; gap: 10px; }

/* --------------------------------------------------------------------------
   Status badges
-------------------------------------------------------------------------- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Source Code Pro', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-draft      { background: #f0f0f0;           color: var(--ink-soft); }
.badge-submitted  { background: var(--info-bg);    color: var(--navy-dark); }
.badge-in_review  { background: var(--warn-bg);    color: var(--warn-ink); }
.badge-approved   { background: var(--success-bg); color: var(--success-ink); }
.badge-denied     { background: var(--error-bg);   color: var(--error-ink); }

/* --------------------------------------------------------------------------
   Staff table
-------------------------------------------------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  font-size: 0.9rem;
}
.data-table th {
  text-align: left;
  background: #f0f0f0;
  padding: 11px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  border-bottom: 2px solid var(--border);
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #f9f9f9; }
.data-table .mono { font-family: 'Source Code Pro', monospace; font-size: 0.82rem; }

/* --------------------------------------------------------------------------
   Empty states
-------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--ink-faint);
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.3; margin-bottom: 16px; }
.empty-state p { font-size: 0.9rem; margin: 0; }

/* --------------------------------------------------------------------------
   Form page header
-------------------------------------------------------------------------- */
.page-header {
  background: var(--navy-dark);
  color: #fff;
  padding: 32px 20px 28px;
  margin-bottom: 0;
}
.page-header-inner {
  max-width: 1040px;
  margin: 0 auto;
}
.page-header .eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 8px;
}
.page-header h1 { color: #fff; font-size: 1.75rem; margin-bottom: 8px; }
.page-header p { color: rgba(255,255,255,0.75); font-size: 0.9375rem; margin: 0; max-width: 600px; }

/* --------------------------------------------------------------------------
   Home page hero
-------------------------------------------------------------------------- */
.hero {
  background: var(--navy-dark);
  color: #fff;
  padding: 64px 20px 56px;
}
.hero-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 60px;
  align-items: center;
}
@media (max-width: 800px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-card { display: none; }
}
.hero h1 { font-size: 2.5rem; color: #fff; margin-bottom: 16px; line-height: 1.15; }
.hero h1 span { color: var(--cyan); }
.hero p { font-size: 1.125rem; color: rgba(255,255,255,0.8); margin-bottom: 28px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 28px;
}
.hero-card h3 { color: #fff; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; opacity: 0.7; }
.hero-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}
.hero-step:last-child { margin-bottom: 0; }
.hero-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--navy-dark);
  font-size: 0.8rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hero-step-text { font-size: 0.9rem; color: rgba(255,255,255,0.85); padding-top: 4px; }

.features {
  max-width: 1040px;
  margin: 0 auto;
  padding: 56px 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 720px) { .features { grid-template-columns: 1fr; } }
.feature-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.feature-icon {
  width: 44px; height: 44px;
  background: var(--navy-light);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature-icon svg { width: 22px; height: 22px; fill: var(--navy); }
.feature-item h3 { font-size: 1rem; margin-bottom: 8px; }
.feature-item p { font-size: 0.875rem; color: var(--ink-soft); margin: 0; }

/* --------------------------------------------------------------------------
   Form actions bar
-------------------------------------------------------------------------- */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Utility
-------------------------------------------------------------------------- */
.text-faint { color: var(--ink-faint); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.78rem; }
.mono { font-family: 'Source Code Pro', monospace; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.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; }

/* --------------------------------------------------------------------------
   Spinner
-------------------------------------------------------------------------- */
.spinner-wrap { text-align: center; padding: 48px; color: var(--ink-faint); font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Footer
-------------------------------------------------------------------------- */
.site-footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.5);
  text-align: center;
  font-size: 0.78rem;
  padding: 24px 20px;
  margin-top: auto;
}
.site-footer a { color: rgba(255,255,255,0.6); }

/* --------------------------------------------------------------------------
   Responsive tweaks
-------------------------------------------------------------------------- */
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero { padding: 40px 16px; }
  .page-wrap { padding: 24px 16px 60px; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn { text-align: center; justify-content: center; }
}

/* --------------------------------------------------------------------------
   Focus visible (accessibility)
-------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Reduced motion
-------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
</style>
