/* ============================================================
   XTERRA HEALTH PORTAL — SHARED STYLES
   File: assets/portal.css
   Included in all three HTML pages
   ============================================================ */

/* ── FONTS ─────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=Barlow:wght@300;400;500;600&display=swap');

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --red:        #C0282D;
  --red-dark:   #9a1f23;
  --red-light:  #fdf2f2;
  --black:      #141414;
  --dark:       #1e1e1e;
  --charcoal:   #2d2d2d;
  --mid:        #6b6b6b;
  --light-gray: #f4f4f2;
  --border:     #e2e2e0;
  --white:      #ffffff;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  --radius:     8px;
  --radius-lg:  14px;
  --shadow:     0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--black);
  background: var(--light-gray);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }

/* ── NAV BAR ────────────────────────────────────────────────── */
#nav {
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.nav-logo img { height: 28px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  transition: color .15s, background .15s;
  background: none;
  border: none;
  letter-spacing: .02em;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.12); }
.btn-logout { color: rgba(255,255,255,0.45); }
.btn-logout:hover { color: #fff; background: rgba(192,40,45,0.3); }
.nav-user {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  font-weight: 400;
  margin-left: 8px;
  white-space: nowrap;
}

/* ── PAGE WRAPPER ───────────────────────────────────────────── */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.page-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

/* ── HEADINGS ───────────────────────────────────────────────── */
.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--mid);
  margin-bottom: 32px;
}
.section-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 12px;
}

/* ── FORMS ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--black);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,40,45,0.08);
}
.field-msg {
  font-size: 12px;
  margin-top: 5px;
  color: var(--mid);
}
.field-msg.error { color: var(--red); }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--red-dark); }
.btn-secondary { background: var(--light-gray); color: var(--black); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: #ebebea; }
.btn-ghost { background: none; color: var(--mid); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--light-gray); color: var(--black); }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-fill {
  height: 100%;
  background: var(--red);
  border-radius: 99px;
  transition: width .4s ease;
}

/* ── STEP ITEMS ─────────────────────────────────────────────── */
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  background: var(--white);
  transition: border-color .15s;
}
.step-item.complete { border-color: #86efac; background: #f0fdf4; }
.step-item.active   { border-color: var(--red); }
.step-item.locked   { opacity: .5; pointer-events: none; }
.step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--light-gray);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--mid);
}
.step-item.complete .step-num { background: #16a34a; border-color: #16a34a; color: #fff; }
.step-item.active .step-num   { background: var(--red); border-color: var(--red); color: #fff; }
.step-body { flex: 1; min-width: 0; }
.step-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 2px;
}
.step-desc { font-size: 13px; color: var(--mid); }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-complete { background: #dcfce7; color: #166534; }
.badge-progress { background: #fef9c3; color: #854d0e; }
.badge-pending  { background: var(--light-gray); color: var(--mid); }

/* ── TABLE ──────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table th {
  text-align: left;
  padding: 10px 14px;
  background: var(--light-gray);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--mid);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--black);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--light-gray); }
.check-cell { text-align: center; font-size: 16px; }

/* ── TOAST ──────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.toast-info    { background: var(--black); color: #fff; }
#toast.toast-success { background: #16a34a; color: #fff; }
#toast.toast-error   { background: var(--red); color: #fff; }

/* ── LOADING OVERLAY ────────────────────────────────────────── */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.modal-desc {
  font-size: 13px;
  color: var(--mid);
  margin-bottom: 22px;
  line-height: 1.6;
}
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* ── ALERT BOX ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-error   { background: var(--red-light); color: var(--red-dark); border: 1px solid #fca5a5; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #86efac; }

/* ── DIVIDER ────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}
