/* ── First Due Theme — HFFA Local 1463 Maui Division ─────────────────────────
   Fonts: Barlow Semi Condensed (headers/labels) + Inter (body/questions/buttons)
   Palette: Navy #162035 · Red #C0392B · Teal #0E7490 · Warm slate background
──────────────────────────────────────────────────────────────────────────── */

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

:root {
  /* Colors */
  --navy:    #162035;
  --navy2:   #1E2E4A;
  --red:     #C0392B;
  --teal:    #0E7490;
  --bg:      #ECF0F5;
  --card:    #FFFFFF;
  --text:    #1E293B;
  --body:    #4A5568;
  --light:   #7A8FA6;
  --border:  #D8E0EA;
  --lgray:   #EFF2F6;
  --input-bg:#F7F9FC;
  --blue-bg: #EFF6FF;
  --blue-bd: #BFDBFE;
  --blue-tx: #1D4ED8;
  --teal-bg: #ECFEFF;
  --teal-bd: #A5F3FC;
  --green:   #16A34A;
  --radius:  14px;
  --radius-sm: 9px;
  --shadow:  0 2px 8px rgba(22,32,53,0.09);
  --shadow-sm: 0 1px 3px rgba(22,32,53,0.07);

  /* Fonts */
  --font-head: 'Barlow Semi Condensed', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ── */
.container { max-width: 620px; margin: 0 auto; padding: 0 20px; }
.page-body { padding: 24px 20px 56px; }

/* ── Site Header ── */
.site-header { background: var(--navy); padding: 36px 24px 30px; }
.site-header .container { padding: 0; }

.badge {
  display: inline-block; background: var(--red); color: #fff;
  font-family: var(--font-head); font-size: 11px; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase;
  padding: 5px 13px; border-radius: 6px; margin-bottom: 14px;
}
.badge-ff1 { background: var(--teal); }

.site-header h1 {
  font-family: var(--font-head); color: #fff;
  font-size: 34px; font-weight: 900; line-height: 1.1; margin-bottom: 6px;
}
.org {
  font-family: var(--font-head); font-size: 10px; font-weight: 700;
  color: #8899AA; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 12px;
}
.tagline { color: #8899AA; font-size: 14px; line-height: 1.7; font-weight: 400; }

/* ── Cards ── */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.card h2 {
  font-family: var(--font-head); font-size: 17px; font-weight: 800;
  color: var(--navy); margin-bottom: 10px; letter-spacing: 0.01em;
}
.card p { font-size: 14px; color: var(--body); line-height: 1.8; margin-bottom: 10px; font-weight: 400; }
.card p:last-child { margin-bottom: 0; }

/* ── Notices ── */
.notice-box {
  border-radius: var(--radius-sm); padding: 13px 16px;
  font-size: 13px; font-weight: 500; line-height: 1.65; margin-bottom: 20px;
}
.notice-blue { background: var(--blue-bg); border: 1.5px solid var(--blue-bd); color: var(--blue-tx); }
.notice-teal { background: var(--teal-bg); border: 1.5px solid var(--teal-bd); color: var(--teal); }

/* ── Buttons ── */
.btn {
  display: inline-block; border: none; border-radius: var(--radius-sm);
  padding: 15px 24px; font-family: var(--font-body); font-size: 15px;
  font-weight: 700; cursor: pointer; text-align: center;
  transition: opacity 0.15s, transform 0.1s; letter-spacing: 0.01em;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-teal    { background: var(--teal); color: #fff; }
.btn-secondary { background: var(--lgray); color: var(--navy); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--body); }
.btn-large { width: 100%; padding: 17px; font-size: 16px; margin-bottom: 12px; display: block; }

/* ── Inputs ── */
input[type="password"], input[type="text"], textarea {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 15px; font-size: 15px; font-family: var(--font-body);
  color: var(--text); background: var(--input-bg); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="password"]:focus, input[type="text"]:focus, textarea:focus {
  border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22,32,53,0.1);
}
input.input-error { border-color: var(--red); }
textarea { resize: vertical; line-height: 1.65; }

/* ── Messages ── */
.error-msg { font-size: 13px; font-weight: 600; color: var(--red); margin-top: 8px; }
.hidden { display: none !important; }
.meta-text { font-size: 13px; color: var(--light); text-align: center; margin-top: 8px; font-weight: 500; }

/* ── Gate Page ── */
.gate-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.gate-header { background: var(--navy); padding: 48px 24px 40px; text-align: center; }
.gate-header h1 {
  font-family: var(--font-head); color: #fff;
  font-size: 34px; font-weight: 900; line-height: 1.15; margin-bottom: 8px;
}
.gate-body { flex: 1; display: flex; align-items: flex-start; justify-content: center; padding: 28px 20px; }
.gate-body .card { width: 100%; max-width: 440px; }
.gate-body h2 {
  font-family: var(--font-head); font-size: 20px; font-weight: 800;
  color: var(--navy); margin-bottom: 8px;
}
.gate-body p { font-size: 14px; color: var(--body); margin-bottom: 18px; line-height: 1.75; }
.gate-body input { margin-bottom: 12px; }

/* ── Survey choice cards ── */
.survey-choice {
  display: block; border-radius: var(--radius); padding: 22px 24px;
  margin-bottom: 12px; cursor: pointer; text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.survey-choice:hover { opacity: 0.93; transform: translateY(-1px); }
.survey-choice:active { transform: translateY(0); }
.survey-choice-ranked { background: var(--navy); }
.survey-choice-ff1    { background: var(--teal); }
.survey-choice-label {
  font-family: var(--font-head); font-size: 11px; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}
.survey-choice-title {
  font-family: var(--font-head); font-size: 20px; font-weight: 800;
  color: #fff; margin-bottom: 4px; letter-spacing: 0.01em;
}
.survey-choice-sub { font-size: 13px; font-weight: 400; color: rgba(255,255,255,0.65); line-height: 1.55; }

/* ── Apparatus Chart ── */
.apparatus-chart { border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; margin: 16px 0; }
.chart-header { background: var(--navy); display: flex; justify-content: space-between; padding: 9px 14px; }
.chart-header span { font-family: var(--font-head); font-size: 11px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 0.1em; }
.chart-header span:last-child { color: #8899AA; font-size: 10px; }
.chart-row { padding: 10px 14px; border-bottom: 1px solid #EDF0F5; }
.chart-row:nth-child(even) { background: #F8FAFC; }
.chart-row:last-child { border-bottom: none; }
.chart-row.chart-row-zero { background: #FEF2F2; }
.chart-row-inner { display: flex; align-items: center; gap: 10px; }
.chart-label { width: 54px; font-size: 12px; font-weight: 800; flex-shrink: 0; color: var(--navy); font-family: var(--font-head); letter-spacing: 0.02em; }
.chart-row-zero .chart-label { color: var(--red); }
.chart-bar-wrap { flex: 1; background: #E2E8F0; border-radius: 4px; height: 9px; overflow: hidden; }
.chart-bar { height: 9px; border-radius: 4px; transition: width 0.5s ease; }
.chart-count { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; flex-shrink: 0; min-width: 54px; text-align: right; }
.chart-count .of-total { font-weight: 400; color: var(--light); font-size: 11px; }
.chart-count.zero { color: var(--red); font-weight: 800; }
.chart-note { font-size: 11px; color: var(--light); font-style: italic; padding-left: 64px; margin-top: 3px; line-height: 1.4; }
.chart-row-zero .chart-note { color: #E57373; }
.chart-legend { background: var(--lgray); padding: 7px 14px; display: flex; gap: 16px; flex-wrap: wrap; }
.chart-legend span { font-size: 11px; color: var(--light); }

/* ── Survey Wrapper ── */
.survey-wrapper { display: flex; flex-direction: column; height: 100vh; }

/* Survey Header */
.survey-header { background: var(--navy); padding: 18px 20px 22px; flex-shrink: 0; }
.survey-header.ff1-header { background: var(--teal); }
.survey-header .container { padding: 0; }

.progress-bar { display: flex; gap: 4px; margin-bottom: 16px; }
.progress-seg { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.15); transition: background 0.3s; }
.progress-seg.active { background: var(--red); }
.ff1-header .progress-seg.active { background: rgba(255,255,255,0.9); }

.section-counter {
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.45); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 4px;
}
.survey-header h2 {
  font-family: var(--font-head); color: #fff;
  font-size: 26px; font-weight: 900; line-height: 1.15; margin-bottom: 6px;
}
.section-subtitle { color: rgba(255,255,255,0.6); font-size: 13px; line-height: 1.55; font-weight: 400; }
.ff1-header .section-subtitle { color: rgba(255,255,255,0.65); }

.survey-body { flex: 1; overflow-y: auto; padding: 18px 16px 12px; }

/* Bottom nav */
.survey-nav { flex-shrink: 0; background: #fff; border-top: 1px solid var(--border); padding: 14px 20px; }
.survey-nav .container { display: flex; gap: 10px; padding: 0; }

/* ── Question Cards ── */
.q-card {
  background: var(--card); border-radius: var(--radius);
  padding: 20px 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(216,224,234,0.6);
}
.q-text {
  font-size: 15px; font-weight: 600; color: var(--text);
  line-height: 1.6; margin-bottom: 16px; letter-spacing: -0.01em;
}
.q-required { color: var(--red); }

/* Pill options */
.pill-group { display: flex; flex-wrap: wrap; gap: 9px; }

.pill-btn {
  padding: 10px 15px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--input-bg);
  color: var(--text); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: var(--font-body); line-height: 1.45;
  text-align: left; transition: all 0.12s;
}
.pill-btn:hover { border-color: #94A3B8; background: #F1F4F8; }
.pill-btn.selected {
  border: 2px solid var(--navy); background: var(--navy);
  color: #fff; font-weight: 700;
}
.ff1-survey .pill-btn.selected { border-color: var(--teal); background: var(--teal); }

/* Multi select */
.multi-hint { font-size: 12px; color: var(--light); font-style: italic; margin-bottom: 11px; font-weight: 500; }

.multi-btn {
  display: flex; align-items: center; gap: 9px; padding: 10px 15px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--input-bg); color: var(--text); font-size: 14px;
  font-weight: 500; cursor: pointer; font-family: var(--font-body);
  line-height: 1.45; text-align: left; transition: all 0.12s;
}
.multi-btn:hover { border-color: #94A3B8; background: #F1F4F8; }
.multi-btn.selected {
  border: 2px solid var(--navy); background: var(--navy);
  color: #fff; font-weight: 700;
}
.ff1-survey .multi-btn.selected { border-color: var(--teal); background: var(--teal); }

.checkbox-box {
  width: 16px; height: 16px; border-radius: 4px;
  border: 1.5px solid #94A3B8; background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fff; flex-shrink: 0; transition: all 0.12s;
}
.multi-btn.selected .checkbox-box { background: var(--red); border-color: var(--red); }

/* Scale */
.scale-group { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }

.scale-btn {
  padding: 11px 4px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--input-bg);
  color: var(--text); font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: var(--font-body); text-align: center;
  line-height: 1.3; transition: all 0.12s;
}
.scale-btn:hover { border-color: #94A3B8; background: #F1F4F8; }
.scale-btn.selected {
  border: 2px solid var(--navy); background: var(--navy);
  color: #fff; font-weight: 700;
}
.ff1-survey .scale-btn.selected { border-color: var(--teal); background: var(--teal); }

.scale-selected-label {
  margin-top: 9px; font-size: 13px; font-weight: 700;
  color: var(--navy); min-height: 20px;
}

/* ── Results Header ── */
.results-header { background: var(--navy); padding: 20px 24px 18px; }
.results-header .container { padding: 0; }
.results-header h1 {
  font-family: var(--font-head); color: #fff;
  font-size: 26px; font-weight: 900; margin-bottom: 2px;
}
.results-meta { font-size: 12px; color: #8899AA; margin-top: 6px; font-weight: 500; }
.results-meta a { color: #60A5FA; text-decoration: underline; }

/* Summary strip */
.summary-strip { display: flex; gap: 10px; margin-bottom: 14px; }
.summary-card { flex: 1; border-radius: var(--radius); padding: 16px 18px; color: #fff; }
.summary-card.ranked-card { background: var(--navy); }
.summary-card.ff1-card    { background: var(--teal); }
.summary-card.total-card-sm { background: #374151; }
.summary-number { font-family: var(--font-head); font-size: 38px; font-weight: 900; line-height: 1; }
.summary-label { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.6); margin-top: 4px; }

.refresh-btn {
  background: rgba(255,255,255,0.1); border: none; color: #fff; border-radius: 8px;
  padding: 9px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); transition: background 0.15s;
}
.refresh-btn:hover { background: rgba(255,255,255,0.18); }

/* Results blocks */
.results-block {
  background: var(--card); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
  border: 1px solid rgba(216,224,234,0.5);
}
.block-title {
  font-family: var(--font-head); font-size: 12px; font-weight: 900;
  color: var(--navy); text-transform: uppercase; letter-spacing: 0.12em;
  padding-bottom: 10px; margin-bottom: 16px; border-bottom: 2px solid var(--lgray);
}

.result-group { margin-bottom: 24px; }
.result-label {
  font-size: 12px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 10px;
}
.multi-note { font-weight: 400; font-size: 11px; color: var(--light); font-style: italic; text-transform: none; letter-spacing: 0; }

.result-row { margin-bottom: 10px; }
.result-row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; gap: 8px; }
.result-row-option { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; flex: 1; }
.result-row-count { font-size: 12px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.result-row-count .pct { font-weight: 400; color: var(--light); }

.bar-bg { background: #E2E8F0; border-radius: 3px; height: 8px; }
.bar-fill { height: 8px; border-radius: 3px; transition: width 0.5s ease; }
.bar-fill-navy { background: var(--navy); }
.bar-fill-teal { background: var(--teal); }

.no-data { font-size: 13px; color: var(--light); font-style: italic; font-weight: 500; }

/* ── Comparison Block ── */
.comparison-block {
  background: var(--card); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow);
  border: 1px solid rgba(216,224,234,0.5);
}
.comparison-title {
  font-family: var(--font-head); font-size: 12px; font-weight: 900;
  color: #374151; text-transform: uppercase; letter-spacing: 0.12em;
  padding-bottom: 10px; margin-bottom: 8px; border-bottom: 2px solid var(--lgray);
}
.comparison-legend { display: flex; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text); }
.legend-dot { width: 11px; height: 11px; border-radius: 2px; flex-shrink: 0; }
.legend-dot-navy { background: var(--navy); }
.legend-dot-teal  { background: var(--teal); }

.priority-row { margin-bottom: 18px; }
.priority-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 9px; line-height: 1.4; }
.priority-bar-row { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.priority-bar-label { font-family: var(--font-head); font-size: 11px; font-weight: 800; width: 54px; flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.06em; }
.priority-bar-label.ranked-label { color: var(--navy); }
.priority-bar-label.ff1-label    { color: var(--teal); }
.priority-bar-track { flex: 1; background: #E2E8F0; border-radius: 3px; height: 9px; }
.priority-bar-fill { height: 9px; border-radius: 3px; transition: width 0.5s ease; min-width: 2px; }
.priority-pct { font-size: 12px; font-weight: 700; min-width: 38px; text-align: right; flex-shrink: 0; }
.priority-pct.ranked-pct { color: var(--navy); }
.priority-pct.ff1-pct    { color: var(--teal); }

/* Text responses */
.text-response {
  background: var(--input-bg); border-left: 3px solid var(--navy);
  padding: 11px 15px; margin-bottom: 9px; border-radius: 0 7px 7px 0;
  font-size: 14px; color: var(--text); line-height: 1.7; font-weight: 400;
}
.text-response.ff1-response { border-left-color: var(--teal); }

/* Loading */
.loading { text-align: center; padding: 60px 20px; color: var(--light); font-size: 15px; font-weight: 500; }

/* ── Thanks Page ── */
.thanks-wrapper {
  min-height: 100vh; background: var(--navy);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.thanks-wrapper.ff1-thanks { background: var(--teal); }
.thanks-emoji { font-size: 58px; margin-bottom: 22px; }
.thanks-wrapper h1 {
  font-family: var(--font-head); color: #fff;
  font-size: 32px; font-weight: 900; margin-bottom: 14px; line-height: 1.15;
}
.thanks-wrapper p {
  color: rgba(255,255,255,0.65); font-size: 15px; line-height: 1.8;
  max-width: 360px; margin: 0 auto 28px; font-weight: 400;
}
.thanks-footer {
  font-family: var(--font-head); font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,0.25); letter-spacing: 0.16em; text-transform: uppercase; margin-top: 20px;
}

/* ── Nav ── */
.nav-links { display: flex; gap: 8px; }
.nav-link-btn {
  background: rgba(255,255,255,0.1); border: none; color: #fff; border-radius: 8px;
  padding: 8px 13px; font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: var(--font-body); text-decoration: none; display: inline-block; transition: background 0.15s;
}
.nav-link-btn:hover { background: rgba(255,255,255,0.18); }

/* ── Top 3 Priority Picker ── */
.top3-hint { font-size: 12px; font-weight: 500; color: var(--light); font-style: italic; margin-bottom: 9px; }
.top3-status {
  font-family: var(--font-head); font-size: 15px; font-weight: 800;
  color: var(--navy); margin-bottom: 14px; min-height: 24px;
  letter-spacing: 0.01em; transition: color 0.2s;
}
.ff1-survey .top3-status { color: var(--teal); }
.top3-status.done { color: var(--green); }

.top3-grid { display: flex; flex-direction: column; gap: 9px; }

.top3-btn {
  position: relative; width: 100%;
  padding: 13px 15px 13px 50px;
  border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--input-bg); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  font-family: var(--font-body); text-align: left; transition: all 0.15s; line-height: 1.45;
}
.top3-btn:hover:not(.dimmed):not(.selected) { border-color: #94A3B8; background: #F1F4F8; }
.top3-btn.selected {
  border: 2px solid var(--navy); background: var(--navy);
  color: #fff; font-weight: 700;
}
.ff1-survey .top3-btn.selected { border-color: var(--teal); background: var(--teal); }
.top3-btn.dimmed { opacity: 0.32; cursor: default; pointer-events: none; }

.top3-rank {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--red); color: #fff;
  font-family: var(--font-head); font-size: 14px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.top3-rank.hidden { display: none; }

/* ── Rating Grid (legacy, kept for compatibility) ── */
.rating-hint {
  display: flex; justify-content: space-between;
  font-size: 12px; font-weight: 500; color: var(--light); font-style: italic; margin-bottom: 14px;
}
.rating-grid { display: flex; flex-direction: column; gap: 14px; }
.rating-item-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.rating-buttons { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.rating-btn {
  border-radius: 5px; border: 1.5px solid var(--border); background: var(--input-bg);
  color: var(--text); font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: var(--font-body); text-align: center; padding: 7px 0; transition: all 0.1s; line-height: 1;
}
.rating-btn:hover { border-color: var(--navy); background: var(--lgray); }
.rating-btn.selected { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 800; }
.ff1-survey .rating-btn:hover { border-color: var(--teal); }
.ff1-survey .rating-btn.selected { background: var(--teal); border-color: var(--teal); }
