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

:root {
  --iz-accent: #4B4EDB;
  --iz-accent-light: #EDEDFB;
  --iz-dark: #1B1B22;
  --iz-text: #111118;
  --iz-muted: #6B6B78;
  --iz-border: #E2E2E8;
  --iz-bg: #F4F4F6;
  --iz-card: #FFFFFF;
  --iz-green: #276749;
  --iz-red: #C53030;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--iz-text);
  background: var(--iz-bg);
  line-height: 1.5;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.page { max-width: 480px; margin: 0 auto; padding: 16px; }
.page-wide { max-width: 640px; margin: 0 auto; padding: 16px; }

/* Cards */
.card {
  background: var(--iz-card);
  border: 1px solid var(--iz-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

/* Section headers */
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--iz-accent);
  margin-bottom: 4px;
}
.section-hint {
  font-size: 0.8rem;
  color: var(--iz-muted);
  margin-bottom: 8px;
}

/* Inputs */
input[type="text"], input[type="number"], input[type="email"], input[type="tel"],
input[type="date"], textarea, select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--iz-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  color: var(--iz-text);
  background: var(--iz-card);
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--iz-accent);
  box-shadow: 0 0 0 3px rgba(232,99,10,0.12);
}
input::placeholder, textarea::placeholder { color: var(--iz-muted); opacity: 0.7; }

label, .field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--iz-muted);
  margin-bottom: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--iz-accent);
  color: white;
}
.btn-primary:active { background: #C05621; }
.btn-secondary {
  background: transparent;
  color: var(--iz-accent);
  border: 1.5px solid var(--iz-accent);
}
.btn-dark {
  background: var(--iz-dark);
  color: white;
}
.btn-dark:active { background: #333; }
.btn-block { width: 100%; }
.btn-green { background: var(--iz-green); color: white; }

/* Pill toggles */
.pill-group { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 8px 16px;
  border: 1.5px solid var(--iz-border);
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--iz-card);
  color: var(--iz-text);
  user-select: none;
}
.pill.active {
  background: var(--iz-accent);
  color: white;
  border-color: var(--iz-accent);
}

/* Option cards (like pleat styles, hanging systems) */
.option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.option-card {
  padding: 12px;
  border: 1.5px solid var(--iz-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.option-card.active {
  border-color: var(--iz-accent);
  background: var(--iz-accent-light);
}
.option-card .option-title { font-weight: 600; font-size: 0.9rem; }
.option-card .option-sub { font-size: 0.75rem; color: var(--iz-muted); }

/* Counter */
.counter { display: flex; align-items: center; gap: 12px; }
.counter button {
  width: 36px; height: 36px;
  border: 1.5px solid var(--iz-border);
  border-radius: 50%;
  background: var(--iz-card);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.counter .count { font-size: 1.5rem; font-weight: 700; min-width: 32px; text-align: center; }

/* Dark result card */
.result-card {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
  color: white;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}
.result-card .result-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--iz-accent);
  margin-bottom: 4px;
}
.result-card .result-value {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.result-card .result-unit {
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 4px;
}

/* Photo upload zone */
.photo-zone {
  border: 2px dashed var(--iz-border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  color: var(--iz-muted);
  cursor: pointer;
  transition: border-color 0.15s;
}
.photo-zone:active { border-color: var(--iz-accent); }

/* Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--iz-accent) 0%, var(--iz-accent) var(--val, 40%), var(--iz-border) var(--val, 40%), var(--iz-border) 100%);
  outline: none;
  border: none;
  padding: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--iz-accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(232,99,10,0.3);
}

/* Notes section */
.notes-section {
  background: #FFFDF7;
  border: 1px solid #F0E6D2;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.notes-section .note-item { margin-bottom: 12px; }
.notes-section .note-en { font-size: 0.9rem; color: var(--iz-text); }
.notes-section .note-hi { font-size: 0.8rem; color: var(--iz-muted); font-style: italic; }

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 8px;
}
.top-bar .back-link {
  font-size: 0.85rem;
  color: var(--iz-muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-orange { background: var(--iz-accent-light); color: var(--iz-accent); }
.badge-green { background: #E6FFED; color: var(--iz-green); }

/* Inline row */
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* Validation */
.blocked-banner {
  background: #FFF5F5;
  border: 1px solid #FEB2B2;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--iz-red);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 0.75rem;
  color: var(--iz-muted);
  border-top: 1px solid var(--iz-border);
  margin-top: 24px;
}

/* Utilities */
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--iz-muted); }
.text-accent { color: var(--iz-accent); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.fw-700 { font-weight: 700; }
.hidden { display: none !important; }

/* Stepper (for Bill Verification) */
.stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
}
.stepper .step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--iz-border);
}
.stepper .step-dot.done { background: var(--iz-green); }
.stepper .step-dot.active { background: var(--iz-accent); width: 24px; border-radius: 4px; }

/* Module card on hub */
.module-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--iz-card);
  border: 1px solid var(--iz-border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--iz-text);
  transition: all 0.15s;
  cursor: pointer;
}
.module-card:active { transform: scale(0.98); }
.module-card .module-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.module-card .module-info { flex: 1; }
.module-card .module-name { font-weight: 700; font-size: 1rem; }
.module-card .module-tag { font-size: 0.8rem; color: var(--iz-muted); }
.module-card .module-arrow { color: var(--iz-muted); font-size: 1.2rem; }

/* Add module card */
.add-module-card {
  border: 2px dashed var(--iz-border);
  text-align: center;
  padding: 20px;
  border-radius: var(--radius);
  color: var(--iz-muted);
  cursor: pointer;
  margin-bottom: 8px;
}
.add-module-card:active { border-color: var(--iz-accent); color: var(--iz-accent); }

@media (max-width: 480px) {
  .page, .page-wide { padding: 12px; }
}
