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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 10px 10px -5px rgba(0,0,0,.04);
  --transition: .2s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

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

.hidden { display: none !important; }
.active { display: block !important; }

/* ===== OVERLAY / DISCLAIMER MODALE ===== */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .3s ease;
}

.overlay:not(.active) { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 640px;
  width: 100%;
  overflow: hidden;
  animation: slideUp .4s cubic-bezier(.34,1.56,.64,1);
}

.modal-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  padding: 2rem;
  text-align: center;
  color: #fff;
}

.modal-icon { font-size: 2.5rem; display: block; margin-bottom: .75rem; }

.modal-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.modal-body {
  padding: 1.75rem 2rem;
  max-height: 55vh;
  overflow-y: auto;
}

.modal-body p { margin-bottom: .75rem; color: var(--text); }

.modal-body ul {
  margin: .5rem 0 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.modal-body li { font-size: .95rem; color: var(--secondary); }

.disclaimer-note {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  padding: .75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .9rem;
  font-weight: 600;
  color: #92400e;
  margin-top: 1rem;
}

.modal-footer {
  padding: 1.25rem 2rem 1.75rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 20px rgba(37,99,235,.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--secondary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--secondary);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

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

.btn-lg {
  padding: .95rem 2.25rem;
  font-size: 1.05rem;
}

/* ===== HEADER ===== */
.site-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #2563eb 100%);
  color: #fff;
  padding: 1.25rem 0;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.logo-icon { font-size: 2rem; }

.logo h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

/* ===== PROGRESS ===== */
.progress-container {
  margin: 2rem 0 1.5rem;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
  border-radius: 9999px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .25rem;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  flex: 1;
  text-align: center;
  opacity: .4;
  transition: opacity var(--transition);
  min-width: 0;
}

.step.active, .step.done { opacity: 1; }

.step-num {
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--secondary);
  transition: all var(--transition);
}

.step.active .step-num {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,.2);
}

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

.step-label {
  font-size: .65rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.25;
  word-break: break-word;
}

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

/* ===== FORM SECTIONS ===== */
.form-section {
  display: none;
  animation: fadeSlide .35s ease;
}

.form-section.active { display: block; }

.section-header {
  margin-bottom: 1.75rem;
}

.section-header h2 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .4rem;
  color: var(--text);
}

.section-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ===== FORM CONTROLS ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

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

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

input[type="number"],
input[type="text"] {
  padding: .8rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  appearance: none;
}

input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.input-prefix {
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input-prefix:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.input-prefix span {
  padding: .8rem .9rem;
  background: var(--bg);
  color: var(--secondary);
  font-weight: 700;
  font-size: .95rem;
  border-right: 2px solid var(--border);
  flex-shrink: 0;
}

.input-prefix input {
  border: none;
  border-radius: 0;
  flex: 1;
}

.input-prefix input:focus {
  outline: none;
  box-shadow: none;
}

small {
  font-size: .84rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== CHECKBOX ITEMS ===== */
.checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-top: .3rem;
}

.checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--surface);
}

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

.checkbox-item input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-item > div strong { display: block; font-size: .97rem; color: var(--text); }
.checkbox-item > div small { font-size: .84rem; color: var(--text-muted); margin-top: 2px; }

/* ===== INFO BOX ===== */
.info-box {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: .93rem;
}

.info-box strong { display: block; margin-bottom: .5rem; color: var(--primary-dark); }
.info-box ul { margin: .4rem 0 .75rem 1.2rem; }
.info-box li { margin-bottom: .25rem; color: var(--text-muted); }
.info-box p { color: var(--text-muted); margin-top: .4rem; }

/* ===== PROPERTY SECTION ===== */
.property-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.property-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}

/* ===== NAV BUTTONS ===== */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

/* ===== RESULT CARD ===== */
.result-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 60%, #2563eb 100%);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: #fff;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 60% 40%, rgba(255,255,255,.07), transparent 60%);
  pointer-events: none;
}

.isee-label {
  font-size: .9rem;
  font-weight: 600;
  opacity: .7;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .5rem;
}

.isee-value {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  margin-bottom: .6rem;
  background: linear-gradient(135deg, #fff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.isee-sublabel {
  font-size: .8rem;
  opacity: .6;
}

.result-category {
  display: inline-block;
  margin-top: 1.25rem;
  padding: .45rem 1.25rem;
  border-radius: 9999px;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .03em;
}

/* ===== DETAIL TABLE ===== */
.result-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.result-details h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

.detail-table tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

.detail-table td {
  padding: .6rem .5rem;
  color: var(--text-muted);
}

.detail-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.detail-table .total-row td {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  padding-top: .9rem;
  border-top: 2px solid var(--primary) !important;
  border-bottom: none !important;
}

.detail-table .bold-row td {
  color: var(--text);
  font-weight: 700;
  background: var(--bg);
}

.detail-table .bold-row td:first-child {
  padding-left: 1rem;
}

/* ===== FASCIA INFO ===== */
.fascia-info {
  margin-bottom: 1.75rem;
}

.fascia-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .75rem;
}

.fascia-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: all var(--transition);
}

.fascia-card.current {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.fascia-card h4 { font-size: .85rem; font-weight: 700; margin-bottom: .2rem; }
.fascia-card p { font-size: .8rem; color: var(--text-muted); }

/* ===== HOW TO OFFICIAL ===== */
.how-to-official {
  background: var(--success-light);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.how-to-official h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #065f46;
  margin-bottom: .75rem;
}

.how-to-official ol {
  margin-left: 1.2rem;
  font-size: .9rem;
  color: #064e3b;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.how-to-official ul {
  margin: .3rem 0 .2rem 1.4rem;
}

/* ===== FINAL DISCLAIMER ===== */
.final-disclaimer {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.final-disclaimer h4 {
  font-size: .9rem;
  font-weight: 700;
  color: #78350f;
  margin-bottom: .4rem;
}

.final-disclaimer p {
  font-size: .82rem;
  color: #92400e;
  line-height: 1.6;
}

/* ===== DISCLAIMER BANNER ===== */
.disclaimer-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .88rem;
  color: #92400e;
  margin-top: .75rem;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #0f172a;
  color: rgba(255,255,255,.55);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: .8rem;
  line-height: 1.7;
}

.site-footer p { margin-bottom: .5rem; }
.site-footer .footer-legal { opacity: .65; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  html { font-size: 16px; }

  .container { padding: 0 1rem; }

  /* Modal */
  .overlay { padding: .75rem; align-items: flex-end; }
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; display: flex; flex-direction: column; }
  .modal-header { padding: 1.25rem 1.25rem 1rem; }
  .modal-icon { font-size: 2rem; }
  .modal-header h2 { font-size: 1.15rem; }
  .modal-body { padding: 1rem 1.25rem; flex: 1; max-height: none; }
  .modal-footer { padding: .9rem 1.25rem 1.25rem; }
  .btn-lg { width: 100%; justify-content: center; font-size: .95rem; }

  /* Header */
  .logo h1 { font-size: 1.1rem; }
  .logo-icon { font-size: 1.6rem; }
  .progress-container { margin: 1.25rem 0 1rem; }

  /* Steps */
  .step-num { width: 28px; height: 28px; font-size: .75rem; }
  .step-label { font-size: .6rem; }

  /* Form */
  .form-grid { grid-template-columns: 1fr; gap: 1rem; }
  .section-header h2 { font-size: 1.3rem; }
  .form-group.full-width { grid-column: 1; }

  /* Buttons */
  .nav-buttons { flex-direction: column-reverse; gap: .75rem; }
  .nav-buttons > div:empty { display: none; }
  .btn { width: 100%; justify-content: center; }

  /* Result */
  .isee-value { font-size: 2.4rem; }
  .result-card { padding: 1.75rem 1.25rem; }
  .fascia-grid { grid-template-columns: 1fr 1fr; }

  /* Table */
  .result-details { padding: 1rem; overflow-x: auto; }
  .detail-table { font-size: .82rem; }
  .detail-table td { padding: .5rem .3rem; }
}
