*, *::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;
  --iz-amber: #C2410C;
  --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: 680px; margin: 0 auto; padding: 16px; }

.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);
}

/* Top bar */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 0; margin-bottom: 8px;
}
.top-bar .badges { display: flex; align-items: center; gap: 8px; }
.back-link {
  font-size: 0.85rem; color: var(--iz-muted); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.back-link:hover { color: var(--iz-text); }

/* App header */
.app-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.app-head h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.app-head .sub { font-size: 0.85rem; color: var(--iz-muted); }

/* Inputs */
input[type="text"], input[type="number"], input[type="email"], input[type="tel"],
textarea, select {
  width: 100%;
  padding: 11px 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, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--iz-accent);
  box-shadow: 0 0 0 3px rgba(75,78,219,0.14);
}
input::placeholder, textarea::placeholder { color: var(--iz-muted); opacity: 0.65; }
textarea { resize: vertical; min-height: 76px; }

.field { margin-bottom: 10px; }
.field-label {
  display: block;
  font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--iz-muted); margin-bottom: 5px;
}
.field-label .req { color: var(--iz-accent); }
.field-label .role-hint {
  font-weight: 500; text-transform: none; letter-spacing: 0; opacity: 0.8;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; 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;
  color: var(--iz-text); background: transparent;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--iz-accent); color: #fff; }
.btn-primary:not(:disabled):active { background: #3B3EC4; }
.btn-secondary { background: transparent; color: var(--iz-accent); border: 1.5px solid var(--iz-accent); }
.btn-dark { background: var(--iz-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--iz-muted); }
.btn-danger { background: transparent; color: var(--iz-red); border: 1.5px solid #F3C6C6; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 24px; font-size: 1.02rem; font-weight: 700; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 7px; }
.btn-whatsapp { background: #25D366; color: #0B1026; font-weight: 700; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.badge-accent { background: var(--iz-accent-light); color: var(--iz-accent); }
.badge-green { background: #E6FFED; color: var(--iz-green); }
.badge-amber { background: #FFF0E8; color: var(--iz-amber); }

/* Notices */
.notice {
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 0.82rem; line-height: 1.5; margin-bottom: 10px;
}
.notice-error { background: #FFF5F5; border: 1px solid #FEB2B2; color: var(--iz-red); }
.notice-info { background: var(--iz-accent-light); border: 1px solid #D6D6F7; color: #3B3EC4; }
.notice-muted { background: #FAFAFB; border: 1px solid var(--iz-border); color: var(--iz-muted); }

/* Sheet — the burned-preview and kept-photo overlays */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.86);
  z-index: 50; display: flex; align-items: flex-end;
}
.sheet {
  width: 100%; max-width: 560px; margin: 0 auto;
  background: #17171C; color: #fff;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + var(--safe-bottom));
  max-height: 92dvh; overflow-y: auto;
}
.sheet h2 { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; }
.sheet .sheet-note {
  font-size: 0.72rem; color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm); padding: 9px 11px; line-height: 1.55; margin-bottom: 12px;
}
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .btn { flex: 1; }
.sheet-actions .btn.wide { flex: 2; }

/* Photos */
.preview-photo { width: 100%; aspect-ratio: 4/3; border-radius: var(--radius-sm); margin-bottom: 12px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery-item {
  border: 1px solid var(--iz-border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--iz-card);
}
.gallery-item .thumb { width: 100%; aspect-ratio: 1; }
.gallery-item .meta { padding: 5px 6px 6px; }
.gallery-item .meta .title {
  font-size: 0.68rem; font-weight: 700; color: var(--iz-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-item .meta .row {
  display: flex; align-items: center; justify-content: space-between; margin-top: 2px;
}
.gallery-item .meta .when { font-size: 0.62rem; color: var(--iz-muted); }
.icon-btn {
  border: none; background: transparent; color: var(--iz-muted);
  cursor: pointer; padding: 2px; display: inline-flex; border-radius: 4px;
}
.icon-btn:hover { color: var(--iz-accent); }

/* Field editor rows */
.fe-row {
  border: 1px solid var(--iz-border); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 8px; background: var(--iz-card);
}
.fe-row.disabled { opacity: 0.55; }
.fe-top { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.fe-top input { flex: 1; }
.fe-controls { display: flex; gap: 4px; align-items: center; }
.fe-opts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fe-opts select { width: auto; flex: 1; min-width: 130px; padding: 7px 9px; font-size: 0.85rem; }
.checkline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--iz-muted); cursor: pointer; user-select: none;
}
.checkline input { width: auto; }

/* Preset picker */
.preset-grid { display: grid; gap: 8px; }
.preset-card {
  text-align: left; padding: 12px; border: 1.5px solid var(--iz-border);
  border-radius: var(--radius-sm); background: var(--iz-card); cursor: pointer;
  font-family: var(--font); color: var(--iz-text); transition: all 0.15s;
}
.preset-card:hover { border-color: var(--iz-accent); }
.preset-card.active { border-color: var(--iz-accent); background: var(--iz-accent-light); }
.preset-card .pname { font-weight: 700; font-size: 0.92rem; }
.preset-card .pblurb { font-size: 0.78rem; color: var(--iz-muted); margin-top: 2px; }

/* Pricing */
.plan {
  border: 1.5px solid var(--iz-border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 10px; background: var(--iz-card);
}
.plan.featured { border-color: var(--iz-accent); box-shadow: 0 0 0 3px rgba(75,78,219,0.1); }
.plan .plan-name { font-weight: 700; font-size: 1.05rem; }
.plan .plan-price { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 2px; }
.plan .plan-per { font-size: 0.85rem; color: var(--iz-muted); font-weight: 500; }
.plan ul { list-style: none; margin: 12px 0; }
.plan li {
  font-size: 0.85rem; color: var(--iz-muted);
  display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px;
}
.plan li .iz-icon { color: var(--iz-green); flex: 0 0 auto; margin-top: 2px; }
.toggle-group {
  display: inline-flex; background: #E8E8EE; border-radius: 999px; padding: 3px; margin-bottom: 16px;
}
.toggle-group button {
  border: none; background: transparent; padding: 7px 16px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer; font-family: var(--font); color: var(--iz-muted);
}
.toggle-group button.active { background: var(--iz-card); color: var(--iz-text); box-shadow: var(--shadow-sm); }

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

/* Utilities */
.iz-icon { display: block; }
.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-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--iz-muted); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.lh { line-height: 1.6; }
.fw-700 { font-weight: 700; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-label {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--iz-muted); margin-bottom: 8px;
}

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