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

:root {
  --primary: #1a5fd4;
  --primary-dark: #1249aa;
  --primary-light: #e8f0fd;
  --accent: #0fa36e;
  --accent-light: #e6f7f1;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- HEADER ---------- */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-left: 1.5rem;
}

header nav a:hover { color: var(--primary); }

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, #1a5fd4 0%, #1249aa 100%);
  color: white;
  text-align: center;
  padding: 3rem 1rem 4rem;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- QUOTER CONTAINER ---------- */
.quoter-wrapper {
  max-width: 720px;
  margin: -2rem auto 3rem;
  padding: 0 1rem;
}

.quoter-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ---------- PROGRESS BAR ---------- */
.progress-header {
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
}

.steps-track {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 0.5rem;
}

.step-dot {
  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(--white);
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: all 0.3s;
}

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

.step-dot.done {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background 0.3s;
}

.step-line.done { background: var(--accent); }

.progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.progress-label span {
  font-weight: 600;
  color: var(--primary);
}

/* ---------- STEP CONTENT ---------- */
.step-content {
  padding: 2rem;
  display: none;
  animation: fadeIn 0.3s ease;
}

.step-content.active { display: block; }

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

.step-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.step-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ---------- FORM ELEMENTS ---------- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

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

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,95,212,0.1);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

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

.field-error {
  font-size: 0.78rem;
  color: #dc2626;
  margin-top: 2px;
  display: none;
}

input.error, select.error { border-color: #dc2626; }

/* ---------- ADDRESS SECTION ---------- */
.address-block {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.address-block-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.address-block-title svg { flex-shrink: 0; }

/* ---------- PROPERTY CARDS ---------- */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.prop-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
}

.prop-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.prop-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.prop-card .prop-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  display: block;
}

.prop-card .prop-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.prop-card .prop-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- ITEMS CHECKLIST ---------- */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.item-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
}

.item-check:hover { border-color: var(--primary); background: var(--primary-light); }
.item-check.checked { border-color: var(--accent); background: var(--accent-light); }

.item-check input[type="checkbox"] { display: none; }

.item-check-box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s;
}

.item-check-box svg { display: none; }
.item-check.checked .item-check-box svg { display: block; }

.item-check.checked .item-check-box {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.item-check-label {
  font-size: 0.85rem;
  font-weight: 500;
}

.item-check-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.item-check.checked .item-check-price { color: var(--accent); font-weight: 600; }

/* ---------- PRICE BADGE (live) ---------- */
.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  border: 1.5px solid #c3d9fb;
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 999px;
  padding: 0.4rem 1rem;
  margin-bottom: 1.5rem;
}

.price-pill small {
  font-weight: 400;
  font-size: 0.78rem;
  opacity: 0.7;
}

/* ---------- SUMMARY ---------- */
.summary-box {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child { border-bottom: none; }
.summary-row .label { color: var(--text-muted); }
.summary-row .value { font-weight: 600; text-align: right; }

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
}

.summary-total .total-label { font-size: 0.95rem; }
.summary-total .total-price { font-size: 1.4rem; font-weight: 700; }
.summary-total .total-note { font-size: 0.72rem; opacity: 0.75; }

/* ---------- BUTTONS ---------- */
.btn-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  flex: 1;
  justify-content: center;
}

.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

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

.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

.btn-success {
  background: var(--accent);
  color: white;
  flex: 1;
  justify-content: center;
}

.btn-success:hover { background: #0a8a5d; transform: translateY(-1px); }

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

/* ---------- SUCCESS SCREEN ---------- */
.success-screen {
  display: none;
  padding: 3rem 2rem;
  text-align: center;
}

.success-screen.active { display: block; }

.success-icon {
  width: 72px;
  height: 72px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 2rem;
}

.success-screen h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.success-screen p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 380px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.success-ref {
  display: inline-block;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ---------- TRUST BAR ---------- */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.trust-item svg { color: var(--accent); flex-shrink: 0; }

/* ---------- FOOTER ---------- */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---------- LOADING ---------- */
.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

/* ---------- TOOLTIP ---------- */
.tooltip-wrap { position: relative; display: inline-block; }
.tooltip-wrap:hover .tooltip { visibility: visible; opacity: 1; }
.tooltip {
  visibility: hidden;
  opacity: 0;
  background: var(--text);
  color: white;
  font-size: 0.78rem;
  border-radius: 6px;
  padding: 5px 10px;
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 10;
}
