/* ═══════════════════════════════════════════════════════
   Reorder Patient Form — Wizard Styles
   Multi-step wizard, mobile-first, Stripe-style
   ═══════════════════════════════════════════════════════ */

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

:root {
  --primary: #0B6E4F;
  --primary-light: #E8F5F0;
  --primary-dark: #064A35;
  --accent: #2196A4;
  --accent-light: #E3F6F8;
  --success: #16a34a;
  --success-light: #DCFCE7;
  --warning: #D69E2E;
  --warning-bg: #FFFBEB;
  --danger: #C53030;
  --danger-bg: #FFF5F5;
  --bg: #F7FAF9;
  --card-bg: #FFFFFF;
  --text: #1B2B3A;
  --text-secondary: #4A6274;
  --text-muted: #8A9DAD;
  --border: #E4EBF0;
  --border-light: #F0F4F3;
  --border-focus: #0B6E4F;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(11,110,79,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(11,110,79,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 24px rgba(11,110,79,0.1), 0 4px 8px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

h1, h2, h3, h4 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

.hidden { display: none !important; }

/* ─── Loading / Error screens ─── */

#loading-screen, #error-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem;
  text-align: center;
}

.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.25rem;
}

#loading-screen p { color: var(--text-secondary); font-size: 0.95rem; font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }

#error-screen .error-icon { font-size: 3rem; margin-bottom: 1rem; }
#error-screen h2 { margin-bottom: 0.5rem; color: var(--text); }
#error-screen p { color: var(--text-secondary); max-width: 400px; }

/* ─── Main app container ─── */

#app {
  display: none;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── Step Indicator ─── */

.step-indicator {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card-bg);
  padding: 0.75rem 1rem 0.5rem;
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
  height: auto;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.step-track {
  position: absolute;
  top: 50%;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: var(--border);
  transform: translateY(-8px);
}

.step-track-fill {
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 200ms linear;
}

.step-circles {
  display: flex;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: default;
  transition: all 200ms ease;
  position: relative;
}

.step-circle .step-check { display: none; }
.step-circle .step-num { display: inline; }

.step-circle.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.step-circle.completed {
  background: var(--success);
  border-color: var(--success);
  color: white;
  cursor: pointer;
}

.step-circle.completed .step-num { display: none; }
.step-circle.completed .step-check { display: inline; font-size: 0.7rem; }

.step-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.125rem;
}

.step-labels span {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  flex: 1;
  text-align: center;
  font-weight: 500;
}

@media (max-width: 375px) {
  .step-labels { display: none; }
}

/* ─── Wizard viewport & panels ─── */

.wizard-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.wizard-track {
  display: flex;
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  min-height: calc(100vh - 72px);
  min-height: calc(100dvh - 72px);
  touch-action: pan-y;
}

.wizard-panel {
  min-width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.panel-content {
  flex: 1;
  padding: 0.75rem 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.125rem;
  color: var(--text);
}

.panel-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* ─── Patient greeting ─── */

.greeting {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ─── Shipping note (animated red callout) ─── */

@keyframes shippingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 158, 46, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(214, 158, 46, 0); }
}

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

.shipping-note {
  background: #FFFBEB;
  border: 2px solid #F6E05E;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #92400E;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  font-weight: 600;
  animation: shippingFadeIn 400ms ease-out, shippingPulse 2s ease-in-out 3;
  position: relative;
}

.shipping-note::before {
  content: "📦";
  margin-right: 0.375rem;
}

.shipping-note strong {
  color: #78350F;
  font-weight: 700;
}

/* ─── Date card ─── */

.date-card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.date-card-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.date-card-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.date-card-day {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* ─── Step question ─── */

.step-question {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* ─── Decision buttons ─── */

.decision-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.decision-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 56px;
  padding: 0 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.decision-btn:active { transform: scale(0.98); }

.decision-icon {
  font-size: 1.25rem;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.decision-confirm.selected,
.decision-delay.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: 0 0 0 1px var(--primary);
}

.decision-buttons-small { flex-direction: row; }

.decision-small {
  flex: 1;
  height: 52px;
  justify-content: center;
  font-size: 0.9rem;
  gap: 0;
}

.decision-small.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* ─── Delay picker ─── */

.delay-picker {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  animation: slideDown 150ms ease-out;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 300px; }
}

.date-input {
  width: 100%;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  background: white;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  min-height: 48px;
}

.date-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,110,79,0.12);
}

.delay-note-20,
.delay-note {
  font-size: 0.8125rem;
  color: var(--warning);
  margin-top: 0.5rem;
  font-weight: 500;
}

.delay-longer-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* ─── Form fields ─── */

.field-group { margin-bottom: 0.5rem; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
  color: var(--text);
}

.helper-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.field-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-top: 0.375rem;
  font-weight: 500;
}

.native-select,
input[type="text"],
input[type="tel"],
input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  background: white;
  color: var(--text);
  min-height: 48px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.native-select:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11,110,79,0.12);
}

.native-select:disabled,
input:disabled {
  background: var(--border-light);
  color: var(--text-muted);
  cursor: not-allowed;
}

.field-half { display: inline-block; width: calc(50% - 0.375rem); vertical-align: top; }
.field-half:first-child { margin-right: 0.75rem; }

.field-error-active {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(197,48,48,0.1) !important;
}

/* ─── Order Sections ─── */

.order-section {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow);
  transition: all 150ms ease-out;
}

.order-section.opted-out {
  opacity: 0.5;
}

.order-section.opted-out .order-section-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  padding: 0;
  transition: max-height 150ms ease-out, opacity 150ms ease-out;
}

.order-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.375rem;
}

.order-section-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 0;
}

.order-section-body {
  max-height: 600px;
  opacity: 1;
  transition: max-height 150ms ease-out, opacity 150ms ease-out;
}

/* ─── Opt-out checkbox ─── */

.opt-out-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
}

.opt-out-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: auto;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

/* ─── Infusion sets ─── */

.infusion-set-row {
  padding-bottom: 0.375rem;
  margin-bottom: 0.375rem;
  border-bottom: 1px solid var(--border-light);
}

.infusion-set-row:last-of-type {
  border-bottom: none;
}

.infusion-set-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.remove-set-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.remove-set-btn:hover { background: var(--danger-bg); }

.infusion-dropdowns {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.infusion-dropdowns .field-group {
  flex: 1;
  margin-bottom: 0;
}

.infusion-dropdowns .field-half {
  display: block;
  width: auto;
  margin-right: 0;
}

/* ─── Quantity Stepper ─── */

.qty-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.125rem;
}

.qty-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: none;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.qty-btn:hover { background: var(--border-light); }
.qty-btn:active { background: var(--border); }
.qty-btn:disabled { color: var(--border); cursor: default; background: white; }

.qty-value {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  border-left: 1.5px solid var(--border);
  border-right: 1.5px solid var(--border);
  background: var(--border-light);
}

.add-set-link {
  display: inline-block;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.5rem;
  padding: 0.25rem 0;
  text-decoration: none;
}

.add-set-link:hover { text-decoration: underline; }

.infusion-total {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-weight: 500;
}

/* ─── Empty state warning ─── */

.empty-warning {
  background: var(--warning-bg);
  border: 1px solid #F6E05E;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #744210;
  font-weight: 500;
  text-align: center;
  margin-top: 0.5rem;
}

/* ─── Sticky OOP footer ─── */

.sticky-footer {
  position: sticky;
  bottom: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 0.875rem 1.25rem;
  padding-bottom: calc(0.875rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  z-index: 10;
}

.oop-footer-summary {
  margin-bottom: 0.75rem;
}

.oop-footer-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
}

.oop-footer-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
}

.oop-footer-total-amount {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.oop-footer-total-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.oop-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.375rem;
  line-height: 1.4;
  font-style: italic;
}

/* ─── Current value cards (address, insurance) ─── */

.current-address-card,
.insurance-card {
  background: var(--primary-light);
  border: 1px solid rgba(11,110,79,0.1);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.current-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.current-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-dark);
  word-break: break-word;
  overflow-wrap: break-word;
}

.current-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.member-id-mask {
  font-family: monospace;
  letter-spacing: 0.05em;
}

/* ─── Address auto-shrink for long text ─── */

.current-value.address-text {
  word-break: break-word;
  overflow-wrap: break-word;
  transition: font-size 150ms ease;
}

.current-value.address-text.address-long {
  font-size: 0.85rem;
}

.current-value.address-text.address-xlong {
  font-size: 0.75rem;
}

/* New address display in review */
.review-item-after.address-text {
  word-break: break-word;
  overflow-wrap: break-word;
}

.review-item-after.address-text.address-long {
  font-size: 0.85rem;
}

.review-item-after.address-text.address-xlong {
  font-size: 0.75rem;
}

/* ─── Address edit ─── */

.address-edit {
  animation: slideDown 150ms ease-out;
  margin-top: 0.75rem;
}

/* ─── Insurance edit ─── */

.insurance-edit {
  animation: slideDown 150ms ease-out;
  margin-top: 0.5rem;
}

.insurance-edit .field-group {
  margin-bottom: 0.625rem;
}

/* ─── File upload ─── */

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
  min-height: 48px;
}

.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-area p { color: var(--text-muted); font-size: 0.85rem; }

.upload-preview {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.upload-preview .preview-item {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.upload-preview .preview-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.upload-preview .remove-btn {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.55);
  color: white; border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-preview .remove-btn:hover { background: var(--danger); }

/* ─── Review step ─── */

.review-diff {
  margin-bottom: 1.25rem;
}

.review-no-changes {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 1rem;
  text-align: center;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

.review-item {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-light);
}

.review-item:last-child { border-bottom: none; }

.review-item-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.review-item-before {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

.review-item-after {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.125rem;
}

.review-item-arrow {
  color: var(--primary);
  font-size: 0.85rem;
  margin: 0.125rem 0;
}

.review-oop {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.review-oop .oop-disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.375rem;
  line-height: 1.4;
  font-style: italic;
}

/* ─── Buttons ─── */

.btn-continue,
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  padding: 0 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 4px rgba(11,110,79,0.2);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-continue:hover,
.btn-submit:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 8px rgba(11,110,79,0.25);
}

.btn-continue:active,
.btn-submit:active {
  transform: scale(0.98);
}

.btn-continue:disabled,
.btn-submit:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  margin-top: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.btn-back:hover { color: var(--text-secondary); }

/* ─── Step footer (non-sticky) ─── */

.step-footer {
  padding: 1rem 0;
  margin-top: auto;
}

/* ─── Success screen ─── */

#success-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem;
  text-align: center;
}

#success-screen .success-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  width: 80px; height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  font-weight: 700;
}

#success-screen #success-message {
  color: var(--text);
  max-width: 380px;
  line-height: 1.7;
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0;
}

#success-screen p {
  color: var(--text-secondary);
  max-width: 380px;
  line-height: 1.7;
  font-size: 0.95rem;
}

.success-sub {
  margin-top: 0.75rem;
  font-weight: 500;
  color: var(--text-muted) !important;
  font-size: 0.875rem !important;
}

/* ─── Network error banner ─── */

.network-error {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--danger);
  color: white;
  text-align: center;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 100;
  animation: slideDown 200ms ease;
}


/* ─── Infusion inline row (Type | Size | Length) ─── */

.infusion-inline-row {
  display: flex;
  gap: 0.5rem;
}

.infusion-inline-row .field-group {
  flex: 1;
  margin-bottom: 0.375rem;
}

.infusion-inline-row .field-label {
  font-size: 0.75rem;
  margin-bottom: 0.125rem;
}

.infusion-inline-row .native-select {
  padding: 0.5rem 0.375rem;
  font-size: 0.8rem;
  min-height: 40px;
}


/* ─── Skip toggle (top-right of order section) ─── */

.skip-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}

.skip-toggle:hover {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
}

.skip-toggle.active {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.skip-toggle-check {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  background: white;
  position: relative;
  flex-shrink: 0;
  transition: all 0.15s;
}

.skip-toggle.active .skip-toggle-check {
  background: var(--danger);
  border-color: var(--danger);
}

.skip-toggle.active .skip-toggle-check::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.55rem;
  color: white;
  font-weight: 700;
}


/* ─── Yes/No colored borders ─── */

.decision-yes.selected {
  border-color: var(--success) !important;
  background: var(--success-light) !important;
  color: var(--success) !important;
  box-shadow: 0 0 0 1px var(--success) !important;
}

.decision-no.selected {
  border-color: var(--danger) !important;
  background: var(--danger-bg) !important;
  color: var(--danger) !important;
  box-shadow: 0 0 0 1px var(--danger) !important;
}


/* ─── Apartment warning ─── */

.apt-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  background: #FFFBEB;
  border: 1px solid #F6E05E;
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: #92400E;
  line-height: 1.4;
}

.apt-warning-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  background: #F6E05E;
  color: #92400E;
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 1px;
}

/* ─── Responsive ─── */

@media (max-width: 480px) {
  .panel-content { padding: 1rem 1rem; }
  .step-indicator { padding: 0.75rem 1rem 0.5rem; }
  .sticky-footer { padding: 0.75rem 1rem; padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); }
}

/* ─── Accessibility: focus rings ─── */

.decision-btn:focus-visible,
.btn-continue:focus-visible,
.btn-submit:focus-visible,
.qty-btn:focus-visible,
.native-select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ─── Scrollbar ─── */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
