/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --orange-50:  #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-300: #fdba74;
  --orange-400: #fb923c;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --orange-800: #9a3412;
  --orange-900: #7c2d12;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-700:   #374151;
  --gray-800:   #1f2937;
  --gray-900:   #111827;
  --green-500:  #22c55e;
  --red-500:    #ef4444;
  --red-100:    #fee2e2;
  --white:      #ffffff;
  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -2px rgba(0,0,0,.10);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -4px rgba(0,0,0,.10);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,.10), 0 8px 10px -6px rgba(0,0,0,.10);
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, var(--orange-50) 0%, #fff 40%, var(--orange-100) 100%);
  min-height: 100vh;
  color: var(--gray-800);
  line-height: 1.6;
}

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, var(--orange-600) 0%, var(--orange-500) 50%, var(--orange-400) 100%);
  padding: 32px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.site-header::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 50px;
  background: var(--gray-50);
  clip-path: ellipse(55% 100% at 50% 100%);
}

/* Logo placeholder */
.logo-wrapper {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.logo-placeholder {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid rgba(255,255,255,0.9);
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.header-title {
  color: #fff;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 800;
  letter-spacing: -.3px;
  line-height: 1.2;
}
.header-subtitle {
  color: rgba(255,255,255,.85);
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
}
.header-badge {
  display: inline-block;
  background: rgba(255,255,255,.20);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-top: 8px;
  letter-spacing: .5px;
}

/* ===== MAIN CONTAINER ===== */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 60px;
  position: relative;
  top: -30px;
}

/* ===== PROGRESS BAR CARD ===== */
.progress-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  border: 1px solid var(--orange-100);
  position: sticky;
  top: 16px;
  z-index: 100;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.progress-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--orange-500);
}
.progress-track {
  background: var(--gray-100);
  border-radius: var(--radius-full);
  height: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--orange-400), var(--orange-600));
  transition: width .4s cubic-bezier(.4,0,.2,1);
  width: 0%;
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute; right: 0; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  background: var(--orange-600);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--orange-300);
  transition: opacity .3s;
}
.progress-fill[style*="width: 0%"]::after { opacity: 0; }
.progress-steps {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.progress-step {
  font-size: 10px;
  font-weight: 500;
  color: var(--gray-400);
  text-align: center;
  flex: 1;
  transition: color .3s;
}
.progress-step.done { color: var(--orange-500); }

/* ===== FORM CARD ===== */
.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 28px 28px;
  border: 1px solid var(--orange-100);
}
@media (max-width: 480px) {
  .form-card { padding: 20px 16px; }
}

/* ===== SECTION HEADERS ===== */
.section {
  margin-bottom: 28px;
}
.section:last-of-type { margin-bottom: 0; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--orange-700);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--orange-100);
}
.section-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--orange-100), var(--orange-200));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ===== GRID ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 520px) {
  .grid-2 { grid-template-columns: 1fr; gap: 0; }
}

/* ===== FORM FIELDS ===== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field:last-child { margin-bottom: 0; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 4px;
}
label .req { color: var(--orange-500); font-size: 14px; line-height: 1; }

input[type="text"],
input[type="date"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--orange-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(249,115,22,.12);
}
input.is-valid, select.is-valid, textarea.is-valid {
  border-color: var(--green-500);
  background: var(--white);
}
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--red-500);
  background: var(--red-100);
}
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; }
select option[value=""] { color: var(--gray-400); }

/* Custom select arrow */
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: '▾';
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); pointer-events: none; font-size: 13px;
}
.select-wrapper select { padding-right: 36px; }

/* Autocomplete dropdown */
.autocomplete-wrapper { position: relative; }
.autocomplete-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--orange-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.autocomplete-dropdown.show { display: block; }
.autocomplete-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--gray-700);
  transition: background .15s;
  border-bottom: 1px solid var(--gray-100);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--orange-50); color: var(--orange-700); }
.autocomplete-item mark {
  background: none; color: var(--orange-500); font-weight: 700;
}
.autocomplete-loading {
  padding: 12px 14px; font-size: 13px; color: var(--gray-400);
  display: flex; align-items: center; gap: 8px;
}
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--orange-200);
  border-top-color: var(--orange-500);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Error / hint messages */
.field-msg {
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
  display: none;
}
.field-msg.error {
  color: var(--red-500);
  display: none;
  align-items: center;
  gap: 4px;
}
.field-msg.error.show { display: flex; }
.field-msg.success {
  color: var(--green-500);
  display: none;
  align-items: center;
  gap: 4px;
}
.field-msg.success.show { display: flex; }
.field-msg.hint {
  color: var(--gray-400);
  display: none;
  align-items: center;
  gap: 4px;
}
.field-msg.hint.show { display: flex; }

/* Radio card groups */
.radio-group {
  display: grid;
  gap: 10px;
}
.radio-group.col-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 400px) { .radio-group.col-2 { grid-template-columns: 1fr; } }

.radio-card {
  position: relative;
}
.radio-card input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.radio-card label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  background: var(--gray-50);
  user-select: none;
}
.radio-card label .radio-icon { font-size: 20px; flex-shrink: 0; }
.radio-card label .radio-text { display: flex; flex-direction: column; gap: 2px; }
.radio-card label .radio-text strong { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.radio-card label .radio-text span { font-size: 11px; color: var(--gray-400); font-weight: 400; }
.radio-card input:checked + label {
  border-color: var(--orange-500);
  background: var(--orange-50);
  box-shadow: 0 0 0 3px rgba(249,115,22,.10);
  color: var(--orange-700);
}
.radio-card input:checked + label .radio-text strong { color: var(--orange-700); }
.radio-card input:checked + label .radio-check { opacity: 1; }
.radio-check {
  margin-left: auto;
  width: 20px; height: 20px;
  background: var(--orange-500);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s;
  flex-shrink: 0;
}
.radio-check::after { content: '✓'; color: #fff; font-size: 11px; font-weight: 700; }
.radio-group.is-invalid .radio-card label { border-color: var(--red-500); }

/* ===== SUBMIT BUTTON ===== */
.submit-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--orange-500) 0%, var(--orange-600) 100%);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: 28px;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  box-shadow: 0 4px 14px rgba(249,115,22,.40);
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(249,115,22,.50);
}
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  padding: 22px 24px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
}
.modal-header-icon {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.modal-header-text h2 { color: #fff; font-size: 17px; font-weight: 700; }
.modal-header-text p { color: rgba(255,255,255,.80); font-size: 12px; margin-top: 2px; }

.modal-body { padding: 24px; }

.summary-section { margin-bottom: 20px; }
.summary-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--orange-600);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.summary-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--orange-100);
}
.summary-row {
  display: flex;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.summary-row:last-child { border-bottom: none; }
.summary-key { color: var(--gray-500); font-weight: 500; min-width: 130px; flex-shrink: 0; }
.summary-val { color: var(--gray-800); font-weight: 600; word-break: break-word; }

.confirm-box {
  background: var(--orange-50);
  border: 1.5px solid var(--orange-200);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 20px 0;
}
.confirm-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
}
.confirm-label input[type="checkbox"] {
  width: 20px; height: 20px;
  border: 2px solid var(--orange-400);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--orange-500);
}
.confirm-label strong { color: var(--orange-700); }

.wa-btn {
  width: 100%;
  padding: 14px;
  background: #25D366;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .2s, transform .15s, box-shadow .15s;
  box-shadow: 0 4px 12px rgba(37,211,102,.35);
  margin-bottom: 10px;
}
.wa-btn:hover:not(:disabled) { background: #1ebe5d; transform: translateY(-1px); }
.wa-btn:disabled { opacity: .45; cursor: not-allowed; }
.wa-icon { font-size: 20px; }

.modal-close-btn {
  width: 100%;
  padding: 11px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .2s;
}
.modal-close-btn:hover { background: var(--gray-200); }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--gray-900);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  z-index: 2000;
  transform: translateY(80px);
  opacity: 0;
  transition: transform .3s, opacity .3s;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green-500); }
.toast.error { background: var(--red-500); }

/* ===== FOOTER ===== */
.form-footer {
  text-align: center;
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 24px;
  line-height: 1.7;
}
.form-footer a { color: var(--orange-500); text-decoration: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--orange-200); border-radius: 99px; }
