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

:root {
  --primary: #0c6e7a;
  --primary-light: #1496a6;
  --primary-dark: #064952;
  --primary-soft: rgba(12, 110, 122, 0.08);
  --accent: #2bb8a8;
  --accent-warm: #c9a962;
  --bg: #eef4f6;
  --surface: #ffffff;
  --surface-elevated: rgba(255, 255, 255, 0.92);
  --text: #0f2430;
  --text-muted: #5a7280;
  --border: #d4e2e8;
  --border-focus: rgba(12, 110, 122, 0.35);
  --error: #c0392b;
  --error-bg: #fdf3f1;
  --success: #1f9d6a;
  --success-soft: rgba(31, 157, 106, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow-sm: 0 2px 8px rgba(15, 36, 48, 0.04);
  --shadow: 0 8px 32px rgba(12, 110, 122, 0.1);
  --shadow-lg: 0 24px 64px rgba(12, 110, 122, 0.16);
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Vazirmatn', Tahoma, sans-serif;
  --header-height: auto;
  --step-size: 2.5rem;
}

html {
  font-size: clamp(15px, 2.8vw, 16px);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% -10%, rgba(20, 150, 166, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 110%, rgba(43, 184, 168, 0.12) 0%, transparent 50%),
    linear-gradient(165deg, #eef4f6 0%, #e4eef2 45%, #edf3f5 100%);
  z-index: -2;
}

.page-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(12, 110, 122, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(12, 110, 122, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  z-index: -1;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px) clamp(14px, 4vw, 20px) clamp(40px, 8vw, 64px);
}

/* Header */
.header {
  text-align: center;
  margin-bottom: clamp(20px, 5vw, 32px);
  animation: slideDown 0.6s ease both;
}

.header-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--primary), var(--accent));
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(12, 110, 122, 0.28);
  color: #fff;
}

.logo-mark svg {
  width: 28px;
  height: 28px;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(12, 110, 122, 0.25);
}

.title {
  font-size: clamp(1.25rem, 4.5vw, 1.65rem);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: clamp(0.85rem, 2.8vw, 0.95rem);
  max-width: 36ch;
  margin: 0 auto;
}

/* Wizard progress */
.wizard-progress {
  margin-bottom: clamp(20px, 4vw, 28px);
  animation: slideDown 0.6s 0.1s ease both;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.progress-meta strong {
  color: var(--primary);
  font-weight: 700;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width var(--transition);
  width: 33%;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.step-indicators {
  display: flex;
  justify-content: center;
  gap: clamp(6px, 2vw, 12px);
  margin-top: 16px;
  flex-wrap: wrap;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all var(--transition);
  min-height: 44px;
}

.step-indicator .step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}

.step-indicator.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.step-indicator.active .step-num {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
}

.step-indicator.done {
  border-color: rgba(31, 157, 106, 0.35);
  color: var(--success);
}

.step-indicator.done .step-num {
  background: var(--success);
  color: #fff;
}

.step-indicator .step-label {
  display: none;
}

@media (min-width: 480px) {
  .step-indicator .step-label {
    display: inline;
  }
}

/* Form card */
#mainForm {
  background: var(--surface-elevated);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 32px) clamp(16px, 4vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: slideUp 0.55s 0.15s ease both;
}

.step {
  animation: stepIn 0.4s ease both;
}

.step.hidden {
  display: none;
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-title {
  font-size: clamp(1.05rem, 3.5vw, 1.2rem);
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.step-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: clamp(18px, 4vw, 26px);
}

/* Role cards */
.role-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(12px, 3vw, 16px);
}

.role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(24px, 5vw, 32px) clamp(12px, 3vw, 20px);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  min-height: 140px;
  -webkit-tap-highlight-color: transparent;
}

.role-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.role-card:active {
  transform: translateY(0);
}

.role-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-card:has(input:checked) {
  border-color: var(--primary);
  background: linear-gradient(160deg, rgba(12, 110, 122, 0.06), rgba(43, 184, 168, 0.04));
  box-shadow: 0 0 0 4px rgba(12, 110, 122, 0.1), var(--shadow-sm);
}

.role-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  transition: all var(--transition);
}

.role-card:has(input:checked) .role-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 8px 20px rgba(12, 110, 122, 0.25);
}

.role-icon svg {
  width: 26px;
  height: 26px;
}

.role-label {
  font-size: clamp(1rem, 3vw, 1.1rem);
  font-weight: 700;
  color: var(--text);
}

/* Status options */
.status-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 3vw, 18px) clamp(16px, 4vw, 20px);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 600;
  font-size: 0.95rem;
  min-height: 56px;
  background: var(--surface);
  -webkit-tap-highlight-color: transparent;
}

.status-option:hover {
  border-color: var(--primary-light);
  background: var(--primary-soft);
}

.status-option:has(input:checked) {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(12, 110, 122, 0.08), rgba(43, 184, 168, 0.05));
  box-shadow: 0 0 0 3px rgba(12, 110, 122, 0.08);
}

.status-option input {
  accent-color: var(--primary);
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.status-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.status-icon svg {
  width: 18px;
  height: 18px;
}

/* Form fields */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(14px, 3vw, 20px);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.block-unit-row {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: row;
  gap: clamp(14px, 3vw, 20px);
}

.block-unit-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.block-unit-field select {
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  width: 100%;
  min-height: 50px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.block-unit-field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--border-focus);
  background: #fff;
}

.block-unit-field select.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.block-unit-field.block-only {
  flex: 0 0 min(180px, 38%);
}

.block-unit-field.units-field {
  flex: 1 1 auto;
  min-width: 0;
}

.units-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.units-header label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.units-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unit-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.unit-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 52px;
}

.unit-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  min-height: 50px;
}

.unit-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--border-focus);
  background: #fff;
}

.unit-input.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.field-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: -2px 0 6px;
}

.multi-select-wrap {
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.multi-select-wrap.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.ms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin-bottom: 10px;
}

.ms-chips.empty {
  display: none;
  margin-bottom: 0;
}

.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  background: var(--primary-soft);
  border: 1px solid rgba(12, 110, 122, 0.18);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-dark);
  min-height: 36px;
}

.ms-chip-text {
  line-height: 1.2;
}

.ms-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(12, 110, 122, 0.12);
  color: var(--primary-dark);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.ms-chip-remove:hover {
  background: var(--error);
  color: #fff;
}

.ms-block-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ms-block-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  user-select: none;
}

.ms-block-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ms-block-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.ms-block-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--border-focus);
}

.ms-block-option:has(input:checked) .ms-block-label {
  color: var(--primary-dark);
}

.ms-unit-add {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

/* Block + Unit paired selection */
.block-units-select-wrap,
.bu-select {
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.block-units-select-wrap.invalid,
.bu-select.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.bu-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin-bottom: 12px;
}

.bu-chips.empty {
  display: none;
  margin-bottom: 0;
}

.bu-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  background: var(--primary-soft);
  border: 1px solid rgba(12, 110, 122, 0.18);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-dark);
  min-height: 36px;
}

.bu-chip-text {
  line-height: 1.2;
}

.bu-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(12, 110, 122, 0.12);
  color: var(--primary-dark);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.bu-chip-remove:hover {
  background: var(--error);
  color: #fff;
}

.bu-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.bu-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.bu-combobox {
  position: relative;
  flex: 1;
  min-width: 0;
}

.bu-search-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  min-height: 50px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.bu-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--border-focus);
}

.bu-search-input.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.bu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
}

.bu-dropdown.hidden {
  display: none;
}

.bu-dropdown-item {
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.bu-dropdown-item:hover,
.bu-dropdown-item.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.bu-dropdown-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.bu-row-remove {
  flex-shrink: 0;
  width: 50px;
  min-height: 50px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.bu-row-remove:hover {
  border-color: var(--error);
  color: var(--error);
  background: var(--error-bg);
}

.bu-row-remove.hidden {
  display: none;
}

.bu-add-btn {
  width: 100%;
  justify-content: center;
}

.ms-unit-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  min-height: 50px;
}

.ms-unit-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--border-focus);
  background: #fff;
}

.ms-unit-input.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.ms-unit-add-btn {
  min-height: 44px;
  flex-shrink: 0;
  white-space: nowrap;
}

.form-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  width: 100%;
  min-height: 50px;
  -webkit-appearance: none;
  appearance: none;
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-group.notes-field {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #9aadb8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--border-focus);
  background: #fff;
}

.form-group input.invalid,
.form-group textarea.invalid {
  border-color: var(--error);
  background: var(--error-bg);
}

.ltr-input {
  direction: ltr;
  text-align: left;
}

.jalali-date-input {
  cursor: pointer;
  letter-spacing: 0.02em;
}

.jalali-date-input:focus {
  cursor: text;
}

/* Jalali datepicker — match premium form theme */
jdp-container {
  --jdp-primary: var(--primary);
  --jdp-primary-hover: var(--primary-light);
  --jdp-primary-pressed: var(--primary-dark);
  --jdp-bg: var(--surface);
  --jdp-color: var(--text);
  --jdp-font: var(--font);
  --jdp-border-radius: var(--radius-sm);
  --jdp-box-shadow: var(--shadow-lg);
  z-index: 1200 !important;
}

jdp-container .jdp-day.selected,
jdp-container .jdp-day:not(.disabled-day):hover {
  background: var(--primary) !important;
  color: #fff !important;
}

jdp-container .jdp-day.today {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

jdp-container .jdp-btn-today,
jdp-container .jdp-btn-empty,
jdp-container .jdp-btn-close {
  font-family: var(--font) !important;
  border-radius: var(--radius-xs) !important;
}

jdp-container .jdp-month,
jdp-container .jdp-year {
  font-family: var(--font) !important;
  font-weight: 600;
}

.field-error {
  font-size: 0.78rem;
  color: var(--error);
  min-height: 1.1em;
  display: block;
  font-weight: 500;
}

/* Section blocks */
.section-block {
  margin-top: clamp(22px, 4vw, 32px);
  padding-top: clamp(18px, 4vw, 26px);
  border-top: 1px solid var(--border);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.section-desc {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
  margin: -8px 0 14px;
}

/* Vehicle type selector */
.vehicle-type-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.vehicle-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
  min-height: 88px;
  -webkit-tap-highlight-color: transparent;
}

.vehicle-type-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.vehicle-type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vehicle-type-card:has(input:checked) {
  border-color: var(--primary);
  background: rgba(0, 68, 187, 0.04);
  box-shadow: 0 0 0 1px var(--primary);
}

.vehicle-type-icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.vehicle-type-icon svg {
  width: 100%;
  height: 100%;
}

.vehicle-type-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.plate-ui-container.hidden {
  display: none;
}

.plate-ui-container {
  flex: 1;
  min-width: 0;
}

/* Iranian Plate UI */
.plate-wrapper {
  margin-bottom: 16px;
}

.plate-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plate-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.plate-scroll::-webkit-scrollbar {
  display: none;
}

.iran-plate {
  display: flex;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  border: 2.5px solid #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  direction: ltr;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
}

.plate-section {
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 2px solid #1a1a1a;
  padding: 0;
}

.plate-section:first-child {
  border-left: none;
}

.plate-section input,
.plate-section select {
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--font);
  font-weight: 700;
  color: #1a1a1a;
  padding: 12px 4px;
  width: 100%;
  outline: none;
  min-height: 48px;
  font-size: 1rem;
  -moz-appearance: textfield;
}

.plate-section input::-webkit-outer-spin-button,
.plate-section input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.plate-section input::placeholder {
  color: #b0b0b0;
  font-weight: 500;
  opacity: 1;
}

.plate-iran input::placeholder {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.plate-two-digit { width: 54px; flex-shrink: 0; }
.plate-letter { width: 48px; flex-shrink: 0; background: #f0f0f0; }
.plate-letter select { font-size: 1.15rem; cursor: pointer; }
.plate-three-digit { width: 72px; flex-shrink: 0; }

.plate-iran {
  width: 58px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0044bb, #003399);
  color: #fff;
  flex-direction: column;
  padding: 4px 2px;
  gap: 0;
}

.plate-iran-label {
  font-size: 0.55rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  line-height: 1;
}

.plate-iran input {
  color: #fff;
  font-size: 0.95rem;
  padding: 2px;
}

.plate-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 500;
}

/* Iranian Motorcycle Plate UI */
.iran-motorcycle-plate {
  display: flex;
  flex-direction: column;
  width: fit-content;
  max-width: 100%;
  border: 2px solid #1a1a1a;
  border-radius: 6px;
  overflow: hidden;
  background: #f5d000;
  direction: ltr;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.plate-moto-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #1a1a1a;
  background: linear-gradient(180deg, #ffe033 0%, #f5d000 100%);
  border-bottom: 1.5px solid #1a1a1a;
  line-height: 1.2;
}

.plate-moto-body {
  display: flex;
  align-items: stretch;
  background: #f5d000;
}

.iran-motorcycle-plate .plate-section {
  border-left: 1.5px solid #1a1a1a;
}

.iran-motorcycle-plate .plate-section:first-child {
  border-left: none;
}

.iran-motorcycle-plate .plate-section input,
.iran-motorcycle-plate .plate-section select {
  padding: 8px 2px;
  min-height: 38px;
  font-size: 0.88rem;
  color: #1a1a1a;
}

.iran-motorcycle-plate .plate-section input::placeholder {
  color: rgba(26, 26, 26, 0.35);
}

.plate-moto-two-digit { width: 44px; flex-shrink: 0; }
.plate-moto-letter {
  width: 40px;
  flex-shrink: 0;
  background: #e8c400;
}
.plate-moto-letter select {
  font-size: 1rem;
  cursor: pointer;
}
.plate-moto-three-digit { width: 58px; flex-shrink: 0; }

.plate-moto-iran {
  width: 48px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0044bb, #003399);
  color: #fff;
  flex-direction: column;
  padding: 3px 2px;
  gap: 0;
}

.plate-moto-iran .plate-iran-label {
  font-size: 0.48rem;
}

.plate-moto-iran input {
  color: #fff;
  font-size: 0.82rem;
  padding: 1px;
}

.plate-moto-iran input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.btn-remove {
  background: var(--error-bg);
  border: 1.5px solid rgba(192, 57, 43, 0.2);
  color: var(--error);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  flex-shrink: 0;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
}

.btn-remove:hover {
  background: var(--error);
  color: #fff;
}

/* Owner card */
.owner-card {
  background: linear-gradient(160deg, rgba(12, 110, 122, 0.04), rgba(43, 184, 168, 0.02));
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: clamp(16px, 3vw, 20px);
  margin-bottom: 14px;
  animation: stepIn 0.35s ease both;
}

.owner-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.owner-card-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary-dark);
}

.owner-card .form-grid {
  gap: 14px;
}

/* Buttons */
.nav-buttons {
  display: flex;
  gap: 12px;
  margin-top: clamp(24px, 4vw, 32px);
  padding-top: clamp(18px, 3vw, 24px);
  border-top: 1px solid var(--border);
}

.btn {
  padding: 15px 24px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  flex: 1;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 6px 20px rgba(12, 110, 122, 0.28);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(12, 110, 122, 0.32);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary-light);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 10px 18px;
  border-radius: var(--radius-xs);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.btn-outline:hover {
  background: var(--primary-soft);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn.loading {
  pointer-events: none;
  opacity: 0.85;
}

.btn.loading::after {
  content: '';
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Success overlay */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 36, 48, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.35s ease;
}

.success-overlay.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.success-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(36px, 6vw, 52px) clamp(24px, 5vw, 40px);
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

@keyframes successPop {
  from { transform: scale(0.85) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--success), #34d399);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 24px;
  box-shadow: 0 12px 32px rgba(31, 157, 106, 0.35);
  animation: successPulse 2s ease infinite;
}

@keyframes successPulse {
  0%, 100% { box-shadow: 0 12px 32px rgba(31, 157, 106, 0.35); }
  50% { box-shadow: 0 12px 40px rgba(31, 157, 106, 0.5); }
}

.success-card h2 {
  font-size: clamp(1.15rem, 4vw, 1.3rem);
  color: var(--primary-dark);
  margin-bottom: 10px;
  font-weight: 700;
}

.success-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.success-ref {
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--success-soft);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  color: var(--success);
  font-weight: 600;
}

.success-card .btn {
  margin-top: 24px;
  min-width: 140px;
}

/* Error overlay */
.error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 36, 48, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 24px;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.35s ease;
}

.error-overlay.hidden {
  display: none !important;
}

.error-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(32px, 5vw, 44px) clamp(24px, 5vw, 36px);
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: successPop 0.45s ease both;
}

.error-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--error), #e74c3c);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 auto 20px;
}

.error-card h2 {
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.error-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.error-card .btn {
  flex: none;
  min-width: 140px;
}

/* Responsive */
@media (max-width: 768px) {
  .step-indicators {
    gap: 6px;
  }

  .step-indicator {
    padding: 6px 10px;
  }
}

@media (max-width: 520px) {
  #mainForm {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .block-unit-row {
    flex-direction: column;
  }

  .block-unit-field.block-only {
    flex: 1 1 auto;
  }

  .units-header {
    flex-direction: column;
    align-items: stretch;
  }

  .units-header .btn-outline {
    width: 100%;
    justify-content: center;
  }

  .ms-block-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .ms-unit-add {
    flex-direction: column;
  }

  .ms-unit-add-btn {
    width: 100%;
    justify-content: center;
  }

  .role-cards {
    grid-template-columns: 1fr;
  }

  .plate-two-digit { width: 48px; }
  .plate-letter { width: 42px; }
  .plate-three-digit { width: 64px; }
  .plate-iran { width: 52px; }
  .plate-moto-two-digit { width: 40px; }
  .plate-moto-letter { width: 36px; }
  .plate-moto-three-digit { width: 52px; }
  .plate-moto-iran { width: 44px; }

  .iran-motorcycle-plate .plate-section input,
  .iran-motorcycle-plate .plate-section select {
    padding: 7px 1px;
    min-height: 36px;
    font-size: 0.84rem;
  }

  .plate-section input,
  .plate-section select {
    padding: 10px 2px;
    min-height: 44px;
    font-size: 0.95rem;
  }

  .nav-buttons {
    flex-direction: column-reverse;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .section-header .btn-outline {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 375px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .title {
    font-size: 1.15rem;
  }

}

@media (max-width: 320px) {
  .plate-two-digit { width: 42px; }
  .plate-letter { width: 38px; }
  .plate-three-digit { width: 56px; }
  .plate-iran { width: 46px; }
  .plate-moto-two-digit { width: 36px; }
  .plate-moto-letter { width: 32px; }
  .plate-moto-three-digit { width: 46px; }
  .plate-moto-iran { width: 40px; }

  .btn {
    padding: 14px 16px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .progress-fill::after {
    animation: none;
  }
}
