﻿/* ── Page shell ─────────────────────────────────────────── */
#hf-root .hf-shell {
  min-height: 100vh;
  padding: 0 16px 28px;
  position: relative;
}

#hf-root .hf-container {
  max-width: 800px;
  margin: 0 auto;
}

#hf-root .hf-page-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--hf-text);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

#hf-root .hf-page-sub {
  font-size: 0.9rem;
  color: var(--hf-text-muted);
  margin-bottom: 28px;
}

/* ── Step indicator ─────────────────────────────────────── */
#hf-root .hf-steps {
  display: flex;
  align-items: flex-start;
  margin-bottom: 28px;
  padding: 16px 0;
}

#hf-root .hf-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#hf-root .hf-step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: default;
  outline: none;
}

#hf-root .hf-step-btn.clickable {
  cursor: pointer;
}

#hf-root .hf-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid #b8c5d6;
  background: var(--hf-white);
  color: #64748b;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

#hf-root .hf-step-num.active {
  background: var(--hf-primary);
  border-color: var(--hf-primary);
  color: var(--hf-white);
  box-shadow: 0 0 0 4px rgba(30, 106, 181, 0.15);
}

#hf-root .hf-step-num.done {
  background: var(--hf-primary);
  border-color: var(--hf-primary);
  color: var(--hf-white);
}

#hf-root .hf-step-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--hf-text-muted);
  text-align: center;
  white-space: nowrap;
}

#hf-root .hf-step-label.active {
  color: var(--hf-primary);
  font-weight: 700;
}

#hf-root .hf-step-label.done {
  color: var(--hf-primary);
  font-weight: 600;
}

#hf-root .hf-step-connector {
  flex: 1;
  height: 2px;
  margin-top: 15px;
  background: var(--hf-border);
  border-radius: 1px;
  transition: background 0.3s ease;
}

#hf-root .hf-step-connector.done {
  background: linear-gradient(90deg, #003478, #00449e);
}

/* ── Main 2-col layout ──────────────────────────────────── */
#hf-root .hf-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

#hf-root .hf-main {
  flex: 3 1 0;
  min-width: 0;
}

#hf-root .hf-sidebar {
  flex: 2 1 0;
  min-width: 0;
}

/* ── Desktop: sidebar sticky, form scrolls with page ────── */
@media (min-width: 641px) {
  #hf-root .hf-sidebar {
    position: sticky;
    top: 64px;
    /* below sticky steps bar */
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--hf-border) transparent;
  }

  #hf-root .hf-sidebar::-webkit-scrollbar {
    width: 4px;
  }

  #hf-root .hf-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  #hf-root .hf-sidebar::-webkit-scrollbar-thumb {
    background: var(--hf-border);
    border-radius: 2px;
  }
}

@media (max-width: 640px) {
  #hf-root .hf-body {
    flex-direction: column;
  }

  #hf-root .hf-sidebar {
    display: none;
  }
}

/* ── Form card (steps 1+2) ──────────────────────────────── */
#hf-root .hf-form-card {
  background: #F8F8F6;
  border: 1px solid var(--hf-border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--hf-shadow-card);
}

/* ── Form card header ───────────────────────────────────── */
#hf-root .hf-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--hf-border);
}

#hf-root .hf-form-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--hf-primary-light) 0%, #dceffe 100%);
  border: 1px solid var(--hf-primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(30, 106, 181, 0.12);
}

#hf-root .hf-form-header-center {
  flex: 1;
  text-align: left;
  min-width: 0;
}

#hf-root .hf-form-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--hf-text);
  letter-spacing: -0.01em;
}

#hf-root .hf-form-header-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--hf-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
  opacity: 0.7;
}

#hf-root .hf-next-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--hf-primary-light);
  border: 1px solid var(--hf-primary-border);
  border-radius: 20px;
  padding: 5px 11px;
  color: var(--hf-primary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

#hf-root .hf-next-btn:hover {
  background: #d6e8f5;
  box-shadow: 0 2px 8px rgba(30, 106, 181, 0.15);
}

#hf-root .hf-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--hf-border);
  border-radius: 20px;
  padding: 5px 11px;
  color: var(--hf-text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  justify-self: start;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

#hf-root .hf-back-btn:hover {
  background: var(--hf-bg);
  border-color: var(--hf-border-hover);
}

/* ── Card 2 header ───────────────────────────────────────── */
#hf-root .hf-form-header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

#hf-root .hf-form-header-icon-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(30, 106, 181, 0.08);
  margin: 0 auto;
}

#hf-root .hf-form-header-next {
  display: flex;
  justify-content: flex-end;
}

#hf-root .hf-form-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

#hf-root .hf-form-title-centered {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--hf-text);
  text-align: center;
  margin: 0 0 12px 0;
  letter-spacing: -0.01em;
}

#hf-root .hf-divider-line {
  border: none;
  border-top: 1px solid var(--hf-border);
}

/* ── Grid helpers ───────────────────────────────────────── */
#hf-root .hf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--hf-gap);
}

#hf-root .hf-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--hf-gap);
}

#hf-root .hf-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}

#hf-root .hf-stack {
  display: flex;
  flex-direction: column;
  gap: var(--hf-gap);
}

#hf-root .hf-stack-lg {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#hf-root .hf-max-xs {
  max-width: 220px;
}

@media (max-width: 480px) {

  #hf-root .hf-grid-2,
  #hf-root .hf-grid-3 {
    grid-template-columns: 1fr;
  }

  #hf-root .hf-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Step 3 ─────────────────────────────────────────────── */
#hf-root .hf-step3-wrap {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#hf-root .hf-step3-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

#hf-root .hf-step3-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--hf-primary), #4d94d6);
  color: var(--hf-white);
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#hf-root .hf-section-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#hf-root .hf-section-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--hf-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#hf-root .hf-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

#hf-root .hf-step3-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
}

/* ── Field rows ─────────────────────────────────────────── */
#hf-root .hf-row { display: grid; gap: 14px; margin-bottom: 14px; }
#hf-root .hf-row-2 { grid-template-columns: 1fr 1fr; }
#hf-root .hf-row-3 { grid-template-columns: 1fr 1fr 1fr; }
#hf-root .hf-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 560px) {
  #hf-root .hf-row-2,
  #hf-root .hf-row-3 { grid-template-columns: 1fr; }
  #hf-root .hf-row-4 { grid-template-columns: 1fr 1fr; }
}

/* ── Half-width standalone field ────────────────────────── */
#hf-root .hf-field-half { max-width: calc(50% - 7px); }
@media (max-width: 560px) { #hf-root .hf-field-half { max-width: 100%; } }

/* ── Field group ────────────────────────────────────────── */
#hf-root .hf-field-group { display: flex; flex-direction: column; margin-bottom: 14px; }
#hf-root .hf-row .hf-field-group { margin-bottom: 0; }

/* ── Card title ─────────────────────────────────────────── */
#hf-root .hf-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--hf-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hf-border);
}

/* ── Form actions ───────────────────────────────────────── */
#hf-root .hf-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hf-border);
}

/* ── Toggle row (form-level, distinct from .hf-toggle-group) */
#hf-root .hf-toggle-row {
  display: flex;
  border: 1.5px solid var(--hf-border);
  border-radius: var(--hf-radius-md);
  overflow: hidden;
  max-width: 320px;
}
#hf-root .hf-toggle-row.hf-toggle-3 { max-width: none; }
/* templates use .selected (not .active) for the chosen state */
#hf-root .hf-toggle-btn.selected {
  background: linear-gradient(135deg, #00449e 0%, #003478 100%);
  color: #fff;
  font-weight: 600;
}
#hf-root .hf-toggle-btn:hover:not(.selected):not(.active) {
  background: var(--hf-bg-disabled);
  color: var(--hf-text-secondary);
}

/* ── Select wrap (suppresses native chevron, shows lucide) ─ */
#hf-root .hf-select-wrap { position: relative; }
#hf-root .hf-select-wrap .hf-select {
  background-image: none;
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
}
#hf-root .hf-select-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: #9ca3af;
  fill: none;
  pointer-events: none;
}

/* ── Input wrap (calendar / search icon) ───────────────── */
#hf-root .hf-input-wrap { position: relative; }
#hf-root .hf-input-wrap .hf-input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: #6b7280;
  fill: none;
  pointer-events: none;
  z-index: 1;
}
#hf-root .hf-input-wrap input,
#hf-root .hf-input-wrap .flatpickr-input { padding-right: 40px; width: 100%; }

/* ── Collapsible sections ────────────────────────────────── */
#hf-root .hf-collapsible {
  border: 1px solid var(--hf-border);
  border-radius: var(--hf-radius-md);
  overflow: visible;
  margin-bottom: 12px;
}
#hf-root .hf-collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  background: var(--hf-primary-light, #eff6ff);
  border-bottom: 1px solid transparent;
}
#hf-root .hf-collapsible[open] .hf-collapsible-summary {
  border-bottom-color: var(--hf-border);
}
#hf-root .hf-collapsible-summary::-webkit-details-marker { display: none; }
#hf-root .hf-collapsible-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--hf-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#hf-root .hf-icon-collapsible {
  width: 14px; height: 14px; stroke: var(--hf-primary); fill: none; flex-shrink: 0;
}
#hf-root .hf-collapsible-chevron {
  width: 15px; height: 15px; stroke: var(--hf-primary); fill: none;
  transition: transform 0.2s;
  flex-shrink: 0;
}
#hf-root .hf-collapsible[open] .hf-collapsible-chevron {
  transform: rotate(180deg);
}
#hf-root .hf-collapsible-body {
  padding: 16px;
}

/* ── RCA-style flanking HR divider ───────────────────────── */
#hf-root .hf-hr-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--hf-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#hf-root .hf-hr-divider hr {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  border: none;
  border-top: 1.5px solid rgba(0,68,158,0.18);
  height: 0;
}