/* ============================================================
   TRIUMPH PATIENT PORTAL — matches v2 Performance Tech design
   Client-side only. HIPAA-safe. Mobile-first.
   ============================================================ */

:root {
  --bg: #0a0e1a;
  --bg-elevated: #11182a;
  --bg-panel: #161e33;
  --bg-input: #0f1526;
  --navy: #071B3A;
  --royal: #0D3B73;
  --gold: #C9A24A;
  --gold-bright: #E0B756;
  --gold-glow: rgba(201, 162, 74, 0.18);
  --danger: #E85D5D;
  --success: #4CAF7C;

  --text-primary: #FFFFFF;
  --text-secondary: #B0B7C5;
  --text-tertiary: #9CA3B0;
  --text-quiet: #6B7484;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --border-gold: rgba(201, 162, 74, 0.45);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); scroll-behavior: smooth; }
body.portal-body {
  font-family: 'Inter', 'Montserrat', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--gold); color: var(--bg);
  padding: var(--sp-3) var(--sp-4);
  font-weight: 700;
}
.skip-link:focus { left: 0; z-index: 999; }

/* ============================================================ HEADER */
.portal-header {
  background: #06090f;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
}
.portal-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.portal-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text-primary);
}
.portal-brand:hover { text-decoration: none; }
.portal-brand__text { display: flex; flex-direction: column; line-height: 1; }
.portal-brand__name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.portal-brand__sub {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-top: 2px;
}
.portal-back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.portal-back:hover { color: var(--gold); text-decoration: none; }

/* ============================================================ CONTAINERS */
.portal-main { flex: 1; padding: var(--sp-7) 0 var(--sp-8); }
.portal-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.portal-container--narrow { max-width: 780px; }
.portal-container--form { max-width: 860px; }

/* ============================================================ HERO */
.portal-hero {
  text-align: center;
  margin-bottom: var(--sp-7);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.portal-eyebrow {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: var(--gold);
  text-transform: uppercase;
  margin: 0 auto var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--border-gold);
  border-radius: 999px;
  background: var(--gold-glow);
  text-align: center;
}
.portal-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin: 0 auto var(--sp-4);
  line-height: 1.15;
  text-align: center;
  width: 100%;
}
.portal-lede {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

/* ============================================================ CARDS */
.portal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: border-color .2s ease, transform .2s ease;
}
.portal-card__icon {
  color: var(--gold);
  margin-bottom: var(--sp-3);
}
.portal-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: var(--sp-2);
  color: var(--text-primary);
}
.portal-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.portal-card--privacy {
  display: flex;
  gap: var(--sp-5);
  align-items: flex-start;
  border-color: var(--border-gold);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-panel) 100%);
  margin-bottom: var(--sp-6);
}
.portal-card--insurance {
  display: flex;
  gap: var(--sp-5);
  align-items: flex-start;
  border-color: rgba(13, 59, 115, 0.55);
  background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-panel) 100%);
  margin-bottom: var(--sp-6);
}
.privacy-icon {
  color: var(--gold);
  flex-shrink: 0;
  padding-top: var(--sp-1);
}
.privacy-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
}
.privacy-body p { font-size: 14px; margin-bottom: var(--sp-2); }
.privacy-body p:last-child { margin-bottom: 0; }
.privacy-fineprint { color: var(--text-tertiary) !important; font-size: 13px !important; }

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-7);
}

/* ============================================================ CTA */
.portal-cta-block {
  text-align: center;
  padding: var(--sp-7) var(--sp-5);
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  margin-bottom: var(--sp-6);
}
.portal-cta-fineprint {
  margin-top: var(--sp-4);
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: center;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .18s ease;
  min-height: 44px;
  text-decoration: none;
}
.portal-btn:hover { text-decoration: none; transform: translateY(-1px); }
.portal-btn--primary {
  background: var(--gold);
  color: #0a0e1a;
  border-color: var(--gold);
  box-shadow: 0 6px 20px -6px rgba(201, 162, 74, 0.55);
}
.portal-btn--primary:hover {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: #0a0e1a;
}
.portal-btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.portal-btn--ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.portal-btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(232, 93, 93, 0.4);
}
.portal-btn--danger:hover {
  background: rgba(232, 93, 93, 0.1);
  color: var(--danger);
}
.portal-btn--lg {
  padding: var(--sp-4) var(--sp-7);
  font-size: 15px;
  min-height: 56px;
}
.portal-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.portal-help {
  text-align: center;
  padding: var(--sp-5);
  color: var(--text-tertiary);
  font-size: 14px;
}
.portal-help h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

/* ============================================================ FOOTER */
.portal-footer {
  background: #06090f;
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-5) 0;
  text-align: center;
  color: var(--text-quiet);
  font-size: 12px;
}
.portal-footer a { color: var(--text-tertiary); }
.portal-footer a:hover { color: var(--gold); }

/* ============================================================ INTAKE FORM */

/* Progress bar */
.progress-bar {
  position: sticky;
  top: 73px;
  z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--sp-4) 0;
}
.progress-bar__inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}
.progress-bar__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.progress-bar__label strong { color: var(--gold); font-weight: 600; }
.progress-bar__track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
  border-radius: 999px;
  transition: width .35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Step containers */
.step-panel {
  display: none;
  animation: fadeIn .3s ease;
}
.step-panel.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-header {
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border-subtle);
}
.step-header__count {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-2);
}
.step-header__title {
  font-family: 'Cinzel', serif;
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  margin-bottom: var(--sp-2);
}
.step-header__desc {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Form sections */
.form-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.form-section__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border-subtle);
}
.form-section__desc {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
}

/* Field rows */
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.field-row--single { grid-template-columns: 1fr; }
.field-row--two { grid-template-columns: 1fr 1fr; }
.field-row--three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .field-row--two, .field-row--three { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.field--wide { grid-column: 1 / -1; }

.field label,
.field__label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field__label--required::after {
  content: " *";
  color: var(--danger);
}
.field__hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: -2px;
}

/* Text inputs */
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color .18s ease, background .18s ease;
  min-height: 44px;
}
.field textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.55;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.04);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-quiet); }

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
  background: rgba(232, 93, 93, 0.06);
}
.field__error {
  color: var(--danger);
  font-size: 12px;
  display: none;
}
.field.has-error .field__error { display: block; }

/* Radio + Checkbox */
.choice-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.choice-group--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.choice-group--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--sp-2);
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .18s ease;
  font-size: 14px;
  min-height: 44px;
  user-select: none;
}
.choice:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.04);
}
.choice input {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}
.choice input:checked + .choice__label,
.choice:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.08);
  color: var(--text-primary);
}

/* Big radio cards (for gate questions) */
.big-choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
@media (max-width: 640px) {
  .big-choice-group { grid-template-columns: 1fr; }
}
.big-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-4);
  background: var(--bg-input);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all .18s ease;
  text-align: center;
  min-height: 130px;
}
.big-choice:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.04);
  transform: translateY(-2px);
}
.big-choice input { position: absolute; opacity: 0; pointer-events: none; }
.big-choice:has(input:checked) {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.1);
  box-shadow: 0 0 0 4px var(--gold-glow);
}
.big-choice__icon {
  color: var(--gold);
  width: 32px;
  height: 32px;
}
.big-choice__label {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.big-choice__desc {
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* Pain scale */
.pain-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 4px;
  margin-top: var(--sp-2);
}
.pain-scale__btn {
  aspect-ratio: 1;
  min-height: 40px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: all .15s ease;
}
.pain-scale__btn:hover { border-color: var(--gold); color: var(--text-primary); }
.pain-scale__btn.active {
  background: var(--gold);
  color: #0a0e1a;
  border-color: var(--gold);
}
.pain-scale__labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--sp-2);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* File upload */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  cursor: pointer;
  transition: all .18s ease;
  background: var(--bg-input);
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--gold);
  background: rgba(201, 162, 74, 0.06);
}
.upload-zone__icon {
  color: var(--gold);
  margin: 0 auto var(--sp-3);
}
.upload-zone__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}
.upload-zone__desc {
  font-size: 12px;
  color: var(--text-tertiary);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-preview {
  display: none;
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  align-items: center;
  gap: var(--sp-3);
}
.upload-preview.has-file { display: flex; }
.upload-preview__thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  object-fit: cover;
  flex-shrink: 0;
}
.upload-preview__info { flex: 1; min-width: 0; }
.upload-preview__name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-preview__size {
  font-size: 11px;
  color: var(--text-tertiary);
}
.upload-preview__remove {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-tertiary);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  transition: all .15s ease;
}
.upload-preview__remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* Signature pad */
.sig-wrapper {
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #FFFFFF;
  position: relative;
  overflow: hidden;
  min-height: 180px;
}
.sig-canvas {
  width: 100%;
  height: 180px;
  display: block;
  touch-action: none;
}
.sig-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #C0C6D0;
  font-size: 14px;
  font-style: italic;
  pointer-events: none;
  letter-spacing: 0.02em;
}
.sig-placeholder.hidden { display: none; }
.sig-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--sp-3);
  gap: var(--sp-3);
}
.sig-controls small { color: var(--text-tertiary); font-size: 12px; }
.sig-clear {
  background: transparent;
  color: var(--text-tertiary);
  border: 1px solid var(--border-strong);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: all .15s ease;
}
.sig-clear:hover { border-color: var(--gold); color: var(--gold); }

/* Attestation blocks */
.attestation {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.attestation__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-2);
}
.attestation__body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--sp-3);
}
.attestation__body ul { margin: var(--sp-2) 0 var(--sp-2) var(--sp-5); }
.attestation__body strong { color: var(--text-primary); }

/* Review sections */
.review-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-4);
}
.review-section h4 {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--sp-3);
}
.review-list { list-style: none; padding: 0; }
.review-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
}
.review-list li:last-child { border-bottom: none; }
.review-list__label {
  color: var(--text-tertiary);
  flex-shrink: 0;
  max-width: 40%;
}
.review-list__value {
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}
.review-list__value--empty { color: var(--text-quiet); font-style: italic; }

/* Nav */
.step-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-subtle);
}
.step-nav__spacer { flex: 1; }

/* Conditional visibility */
.conditional { display: none; }
.conditional.show { display: block; }

/* Info banner */
.info-banner {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: rgba(13, 59, 115, 0.25);
  border: 1px solid rgba(13, 59, 115, 0.55);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  font-size: 13px;
  color: var(--text-secondary);
}
.info-banner__icon {
  color: #6E9FE0;
  flex-shrink: 0;
}
.info-banner strong { color: var(--text-primary); }

.warn-banner {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: rgba(201, 162, 74, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-4);
  font-size: 13px;
  color: var(--text-secondary);
}
.warn-banner__icon {
  color: var(--gold);
  flex-shrink: 0;
}

.success-banner {
  padding: var(--sp-5);
  background: rgba(76, 175, 124, 0.1);
  border: 1px solid rgba(76, 175, 124, 0.45);
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: var(--sp-5);
}
.success-banner__icon { color: var(--success); margin: 0 auto var(--sp-3); }
.success-banner__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
}

/* Auto-send status */
.autosend {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  margin-top: var(--sp-4);
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel);
}
.autosend svg { flex-shrink: 0; margin-top: 2px; }
.autosend--sending {
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.autosend--ok {
  color: var(--text-primary);
  border-color: rgba(76, 175, 124, 0.55);
  background: rgba(76, 175, 124, 0.12);
}
.autosend--ok svg { color: var(--success); }
.autosend--fail {
  color: var(--text-primary);
  border-color: var(--border-gold);
  background: rgba(201, 162, 74, 0.08);
}
.autosend--fail svg { color: var(--gold); }
.autosend strong { color: var(--text-primary); }
.autosend em { color: var(--gold); font-style: normal; }
.autosend__spin { animation: autosend-spin 1.2s linear infinite; }
@keyframes autosend-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Save indicator */
.save-indicator {
  position: fixed;
  bottom: var(--sp-4);
  right: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-tertiary);
  opacity: 0;
  transform: translateY(20px);
  transition: all .3s ease;
  pointer-events: none;
  z-index: 200;
}
.save-indicator.show { opacity: 1; transform: translateY(0); }

/* Mobile tweaks */
@media (max-width: 640px) {
  .portal-header__inner { padding: var(--sp-3) var(--sp-4); }
  .portal-brand__name { font-size: 16px; }
  .portal-brand__sub { font-size: 10px; }
  .portal-back { font-size: 12px; }
  .portal-main { padding: var(--sp-5) 0; }
  .portal-container { padding: 0 var(--sp-4); }
  .form-section { padding: var(--sp-4); }
  .portal-card--privacy { flex-direction: column; text-align: center; }
  .privacy-icon { margin: 0 auto; }
  .step-nav { flex-direction: column-reverse; }
  .step-nav .portal-btn { width: 100%; }
  .review-list li { flex-direction: column; gap: var(--sp-1); }
  .review-list__value { text-align: left; max-width: 100%; }
  .review-list__label { max-width: 100%; }
  .pain-scale__btn { min-height: 36px; font-size: 12px; }
}
