/* ============================================================
   FANOS Agreement Portal — Design System
   Brand: Navy | Gold | Ivory | Terracotta | Sage
   Fonts: Playfair Display (headings) + Inter (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --navy:         #1D2945;
  --navy-deep:    #141d33;
  --navy-light:   #2a3a5c;
  --gold:         #D89A36;
  --gold-light:   #e8b05a;
  --gold-pale:    #f5dfa0;
  --ivory:        #F7F0E3;
  --ivory-dark:   #ede4d4;
  --terracotta:   #A9573F;
  --sage:         #6F7F70;
  --sage-light:   #8a9c8b;
  --white:        #FFFFFF;
  --gray:         #F4F4F4;
  --gray-mid:     #e0e0e0;
  --gray-dark:    #9a9a9a;
  --error:        #c0392b;
  --success:      #2d7d46;

  --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --radius-xl:    32px;

  --shadow-sm:    0 2px 8px rgba(29,41,69,0.08);
  --shadow-md:    0 8px 32px rgba(29,41,69,0.12);
  --shadow-lg:    0 20px 60px rgba(29,41,69,0.18);
  --shadow-gold:  0 4px 24px rgba(216,154,54,0.25);

  --transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);

  --max-w:        1100px;
  --max-w-form:   720px;
}

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

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--navy);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--font-body); }

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--ivory); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--navy);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { margin-bottom: 1rem; color: #3a4a6a; }
p:last-child { margin-bottom: 0; }

/* ── Layout Utilities ───────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}
.container-form {
  max-width: var(--max-w-form);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }

/* ── Navigation ─────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--navy);
  height: 76px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.nav.scrolled {
  box-shadow: 0 4px 32px rgba(0,0,0,0.3);
  height: 70px;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  height: 38px;
  max-height: 38px;
  width: auto;
  object-fit: contain;
  opacity: 0.95;
  transition: var(--transition);
}
.nav-logo:hover { opacity: 1; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: var(--transition);
}
.nav-links a:hover { color: var(--gold); }
.nav-cta {
  background: var(--gold);
  color: var(--navy) !important;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  transition: var(--transition) !important;
}
.nav-cta:hover {
  background: var(--gold-light) !important;
  color: var(--navy) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}
.nav-admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(216, 154, 54, 0.4);
  border-radius: var(--radius-sm);
  color: var(--gold-pale) !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em;
  transition: var(--transition) !important;
}
.nav-admin-btn:hover {
  background: rgba(216, 154, 54, 0.18);
  border-color: var(--gold);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(216, 154, 54, 0.2);
}

/* Mobile hamburger button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(216, 154, 54, 0.35);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  transition: var(--transition);
}
.nav-toggle:hover {
  background: rgba(216, 154, 54, 0.12);
  border-color: var(--gold);
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.page-content { padding-top: 76px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 0.975rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}
.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-secondary:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-2px);
}
.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-outline-gold:hover {
  background: var(--gold);
  color: var(--navy);
}
.btn-ghost {
  background: transparent;
  color: var(--gray-dark);
  border-color: transparent;
  padding: 14px 20px;
}
.btn-ghost:hover { color: var(--navy); background: var(--gray); }
.btn-lg { padding: 18px 44px; font-size: 1.05rem; }
.btn-sm { padding: 9px 20px; font-size: 0.85rem; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 120px 24px 80px;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%; left: -20%;
  width: 80%; height: 160%;
  background: radial-gradient(ellipse, rgba(216,154,54,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -20%; right: -10%;
  width: 60%; height: 100%;
  background: radial-gradient(ellipse, rgba(111,127,112,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(216,154,54,0.12);
  border: 1px solid rgba(216,154,54,0.3);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 32px;
}
.hero-logo {
  width: min(280px, 55vw);
  margin: 0 auto 40px;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.hero h1 {
  color: var(--white);
  margin-bottom: 24px;
  max-width: 680px;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero-sub {
  color: rgba(255,255,255,0.72);
  font-size: 1.1rem;
  max-width: 540px;
  margin: 0 auto 48px;
  line-height: 1.75;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 72px;
}
.hero-pillars {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  justify-content: center;
}
.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.55);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pillar-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.6;
}

/* ── Process Steps (Welcome) ─────────────────────────────── */
.steps-section {
  background: var(--ivory);
  padding: 80px 0;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin-top: 48px;
}
.step-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: var(--transition);
  border: 1px solid var(--gray-mid);
}
.step-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--gold);
}
.step-number {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.step-card h4 { margin-bottom: 8px; }
.step-card p { font-size: 0.9rem; color: var(--sage); margin: 0; }

/* ── Section Heading with Gold Accent ───────────────────── */
.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.section-heading-line::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin-top: 16px;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 40px;
  border: 1px solid var(--gray-mid);
}
.card-ivory {
  background: var(--ivory);
  border-color: var(--ivory-dark);
}

/* ── PDF Viewer ──────────────────────────────────────────── */
.pdf-header {
  background: var(--navy);
  padding: 32px 0;
  color: var(--white);
}
.pdf-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.pdf-badge {
  background: rgba(216,154,54,0.2);
  border: 1px solid rgba(216,154,54,0.4);
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.04em;
}
.pdf-badge-draft {
  background: rgba(169,87,63,0.15);
  border-color: rgba(169,87,63,0.35);
  color: var(--terracotta);
}
.pdf-container {
  background: var(--gray);
  padding: 24px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.pdf-iframe {
  width: 100%;
  height: 680px;
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  background: var(--white);
}
.pdf-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  padding: 24px 0;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group {
  margin-bottom: 28px;
}
.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}
.form-label .required {
  color: var(--terracotta);
  margin-left: 3px;
  font-weight: 700;
}
.form-label .optional {
  color: var(--gray-dark);
  font-size: 0.78rem;
  font-weight: 400;
  margin-left: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--white);
  transition: var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216,154,54,0.15);
}
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint {
  font-size: 0.82rem;
  color: var(--gray-dark);
  margin-top: 6px;
}
.form-error-msg {
  font-size: 0.82rem;
  color: var(--error);
  margin-top: 6px;
  display: none;
}
.form-error-msg.visible { display: block; }

/* Select arrow */
.select-wrapper {
  position: relative;
}
.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--navy);
  pointer-events: none;
}

/* Checkboxes / Radio */
.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkbox-item,
.radio-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.checkbox-item input[type="checkbox"],
.radio-item input[type="radio"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--gray-mid);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: var(--transition);
  flex-shrink: 0;
}
.radio-item input[type="radio"] { border-radius: 50%; }
.checkbox-item input[type="checkbox"]:checked,
.radio-item input[type="radio"]:checked {
  background: var(--navy);
  border-color: var(--navy);
}
.checkbox-item input[type="checkbox"]:checked::after {
  content: '✓';
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.radio-item input[type="radio"]:checked::after {
  content: '';
  display: block;
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
}
.checkbox-item label,
.radio-item label {
  font-size: 0.935rem;
  color: var(--navy);
  cursor: pointer;
  line-height: 1.5;
}

/* Yes/No toggle buttons */
.toggle-group {
  display: flex;
  gap: 12px;
}
.toggle-btn {
  flex: 1;
  padding: 12px 20px;
  border: 2px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--gold);
  font-weight: 600;
}
.toggle-btn:hover:not(.active) {
  border-color: var(--navy);
  background: var(--ivory);
}

/* ── File Upload ─────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--gray-mid);
  border-radius: var(--radius-md);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray);
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--gold);
  background: rgba(216,154,54,0.05);
}
.upload-zone.has-file {
  border-color: var(--success);
  background: rgba(45,125,70,0.04);
}
.upload-icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  color: var(--gray-dark);
}
.upload-zone.has-file .upload-icon { color: var(--success); }
.upload-text {
  font-size: 0.9rem;
  color: var(--gray-dark);
  margin: 0;
}
.upload-text strong { color: var(--navy); }
.upload-text .link { color: var(--gold); text-decoration: underline; cursor: pointer; }
.upload-filename {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 500;
  margin-top: 8px;
  display: none;
}
.upload-zone.has-file .upload-filename { display: block; }
.upload-input { display: none; }
.upload-fallback {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--ivory);
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #5a6a8a;
  line-height: 1.6;
}
.upload-fallback a { color: var(--gold); font-weight: 500; }

/* ── Acknowledgment Block ────────────────────────────────── */
.ack-block {
  background: var(--ivory);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  margin-bottom: 20px;
}
.ack-block p {
  font-size: 0.9rem;
  color: var(--navy);
  font-style: italic;
  margin: 0;
}

/* ── Survey Progress ─────────────────────────────────────── */
.survey-progress {
  position: sticky;
  top: 76px;
  z-index: 900;
  background: var(--white);
  border-bottom: 1px solid var(--gray-mid);
  padding: 16px 0;
  box-shadow: var(--shadow-sm);
}
.progress-inner {
  max-width: var(--max-w-form);
  margin: 0 auto;
  padding: 0 24px;
}
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.progress-steps::-webkit-scrollbar { display: none; }
.progress-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.progress-step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gray);
  border: 2px solid var(--gray-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gray-dark);
  transition: var(--transition);
  flex-shrink: 0;
}
.progress-step.active .progress-step-dot {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--gold);
}
.progress-step.completed .progress-step-dot {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
}
.progress-step-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gray-dark);
  white-space: nowrap;
  transition: var(--transition);
}
.progress-step.active .progress-step-label { color: var(--navy); font-weight: 600; }
.progress-step.completed .progress-step-label { color: var(--sage); }
.progress-connector {
  flex: 1;
  min-width: 20px;
  height: 2px;
  background: var(--gray-mid);
  margin: 0 6px;
  transition: var(--transition);
}
.progress-connector.done { background: var(--gold); }

/* ── Survey Section ──────────────────────────────────────── */
.survey-section {
  display: none;
  animation: fadeSlideIn 0.3s ease;
}
.survey-section.active { display: block; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.section-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--gray-mid);
}
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: var(--gold);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}
.section-header h2 { margin-bottom: 8px; }
.section-header p { color: var(--sage); font-size: 0.95rem; margin: 0; }

/* ── Legal Notice Box ────────────────────────────────────── */
.legal-notice {
  background: var(--ivory);
  border: 1px solid var(--ivory-dark);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.legal-notice-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 8px;
}
.legal-notice p {
  font-size: 0.88rem;
  color: #5a6a7a;
  margin: 0;
}

/* ── Minor Notice ────────────────────────────────────────── */
.minor-notice {
  background: #fff8ed;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: none;
}
.minor-notice.visible { display: block; }
.minor-notice-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.minor-notice p {
  font-size: 0.875rem;
  color: #5a4a20;
  margin: 0;
  line-height: 1.65;
}

/* ── Survey Navigation ───────────────────────────────────── */
.survey-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 0 48px;
  margin-top: 8px;
  border-top: 1px solid var(--gray-mid);
  gap: 16px;
}
.survey-nav-left,
.survey-nav-right { display: flex; align-items: center; gap: 12px; }

/* ── Submit Button States ────────────────────────────────── */
.btn-submit { position: relative; }
.btn-submit .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(29,41,69,0.25);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { opacity: 0; position: absolute; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error / Info Alerts ─────────────────────────────────── */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 24px;
  display: none;
}
.alert.visible { display: block; }
.alert-error { background: #fdf2f0; border: 1px solid #e8bcb6; color: var(--error); }
.alert-success { background: #f0faf4; border: 1px solid #a8d5b8; color: var(--success); }
.alert-info { background: var(--ivory); border: 1px solid var(--ivory-dark); color: var(--navy); }

/* ── Success / Confirmation Page ─────────────────────────── */
.success-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  background: var(--ivory);
}
.success-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 64px 56px;
  max-width: 560px;
  width: 100%;
  text-align: center;
}
.success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--success);
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.success-icon svg { width: 36px; height: 36px; color: var(--white); stroke: var(--white); }
.success-card h2 { margin-bottom: 12px; }
.success-card > p { color: var(--sage); font-size: 1rem; margin-bottom: 36px; }
.record-table {
  text-align: left;
  width: 100%;
  border-top: 1px solid var(--gray-mid);
  margin-bottom: 32px;
}
.record-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-mid);
  gap: 8px;
}
.record-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-dark);
}
.record-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}
.record-id-badge {
  background: var(--navy);
  color: var(--gold);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 36px;
  letter-spacing: 0.05em;
}
.email-note {
  background: var(--ivory);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--sage);
  margin-bottom: 32px;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.6);
  padding: 40px 0;
  text-align: center;
  font-size: 0.85rem;
}
.footer-logo {
  height: 32px;
  filter: brightness(0) invert(1);
  opacity: 0.5;
  margin: 0 auto 16px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  color: rgba(255,255,255,0.45);
  font-size: 0.8rem;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--gold); }

/* ── Barok Labs Credit ───────────────────────────────────── */
.barok-credit {
  text-align: center;
  font-size: 0.75rem;
  color: var(--gray-dark, #9a9a9a);
  padding: 16px 0;
  margin-top: 32px;
  letter-spacing: 0.02em;
}
.footer .barok-credit {
  color: rgba(255, 255, 255, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 32px;
  padding-top: 16px;
  padding-bottom: 0;
}
.login-footer .barok-credit {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.35);
}

/* ── Privacy Page ────────────────────────────────────────── */
.privacy-page { padding: 100px 0 80px; }
.privacy-page h1 { margin-bottom: 12px; }
.privacy-intro { color: var(--sage); font-size: 1.05rem; margin-bottom: 48px; }
.privacy-section { margin-bottom: 48px; }
.privacy-section h3 {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ivory);
}
.privacy-section p, .privacy-section li { font-size: 0.95rem; color: #4a5a70; }
.privacy-section ul { padding-left: 20px; }
.privacy-section ul li { margin-bottom: 8px; }

/* ── Inline PDF strip (in survey) ───────────────────────── */
.pdf-strip {
  background: var(--navy);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.pdf-strip-info { flex: 1; }
.pdf-strip-title {
  font-family: var(--font-heading);
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.pdf-strip-meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
}
.pdf-strip-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Mobile & Responsive System ─────────────────────────── */

/* Mobile PDF Banner for agreement-pdf.html */
.mobile-pdf-banner {
  display: none;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  border: 1px solid rgba(216, 154, 54, 0.35);
  border-radius: var(--radius-md);
  padding: 20px;
  color: var(--white);
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.mobile-pdf-banner-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.mobile-pdf-banner h3 {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.mobile-pdf-banner p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 16px;
}
.mobile-pdf-banner-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-pdf-banner-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 16px;
}

@keyframes mobileNavSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Tablet & Mobile (<= 768px) ── */
@media (max-width: 768px) {
  .nav {
    height: 68px;
  }
  .nav.scrolled {
    height: 64px;
  }
  .nav-inner {
    padding: 0 16px;
  }
  .nav-logo {
    height: 32px;
    max-height: 32px;
  }
  .nav-toggle {
    display: flex;
  }

  /* Mobile Drawer Menu */
  .nav-links {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: rgba(20, 29, 51, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 3px solid var(--gold);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 24px;
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 999;
  }
  .nav-links.open {
    display: flex;
    animation: mobileNavSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-links li:last-child {
    border-bottom: none;
    margin-top: 14px;
  }
  .nav-links a {
    display: flex;
    align-items: center;
    padding: 14px 4px;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    width: 100%;
  }
  .nav-links .nav-admin-btn {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    margin: 6px 0;
    font-size: 0.9rem !important;
  }
  .nav-links .nav-cta {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    text-align: center;
    font-size: 1rem !important;
  }

  .page-content {
    padding-top: 68px;
  }

  /* Hero Section Mobile */
  .hero {
    min-height: auto;
    padding: 60px 16px 64px;
  }
  .hero-logo {
    max-height: 90px;
    margin-bottom: 24px;
  }
  .hero h1 {
    font-size: clamp(2rem, 8vw, 2.6rem);
    margin-bottom: 16px;
  }
  .hero-sub {
    font-size: 1.05rem;
    margin-bottom: 28px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-pillars {
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-top: 36px;
    justify-content: center;
  }

  /* Sticky Survey Progress on Phones */
  .survey-progress {
    top: 68px;
    padding: 12px 0;
  }
  .progress-inner {
    padding: 0 16px;
  }
  .progress-steps {
    justify-content: space-between;
    gap: 0;
  }
  .progress-step-dot {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
  }
  .progress-connector {
    min-width: 8px;
    margin: 0 2px;
  }
  .progress-step:not(.active) .progress-step-label {
    display: none;
  }
  .progress-step.active .progress-step-label {
    font-size: 0.72rem;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Survey Content & Navigation */
  .survey-nav {
    flex-direction: column-reverse;
    gap: 12px;
  }
  .survey-nav-left, .survey-nav-right {
    width: 100%;
  }
  .survey-nav .btn {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* Touch-friendly Form Controls */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom on input focus */
    padding: 12px 14px;
  }
  .checkbox-item, .radio-item {
    padding: 6px 0;
    min-height: 44px;
  }
  .checkbox-item input[type="checkbox"],
  .radio-item input[type="radio"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
  }
  .toggle-group {
    flex-direction: row;
    gap: 8px;
  }
  .toggle-btn {
    padding: 12px 8px;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* PDF Viewer Page Mobile */
  .mobile-pdf-banner {
    display: block;
  }
  .pdf-actions {
    flex-direction: column;
    gap: 10px;
  }
  .pdf-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .pdf-iframe {
    height: 580px;
  }
  .pdf-meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* General Cards & Layout */
  .steps-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 24px 18px;
  }
  .success-card {
    padding: 36px 20px;
  }
  .record-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .pdf-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  .pdf-strip-actions {
    flex-direction: column;
  }
  .pdf-strip-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Small Phones (<= 480px) ── */
@media (max-width: 480px) {
  .container, .container-form {
    padding: 0 16px;
  }
  h1 {
    font-size: 1.85rem;
  }
  h2 {
    font-size: 1.45rem;
  }
  .btn-lg {
    padding: 14px 24px;
    font-size: 0.98rem;
  }
  .record-id-badge {
    font-size: 0.95rem;
    padding: 8px 14px;
    word-break: break-all;
  }
}
