:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #64748b;
  --line: #dce3eb;
  --brand: #17324d;
  --brand-strong: #0f2438;
  --soft: #eef4f8;
  --success: #146c43;
  --warning: #8a5a00;
  --danger: #9f1d24;
  --shadow: 0 16px 50px rgba(26, 45, 68, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, .link-button { min-height: 44px; }
.hidden { display: none !important; }

.app-header {
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: white;
  padding: 28px max(20px, env(safe-area-inset-left)) 42px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
}
.app-header h1 { margin: 4px 0 8px; font-size: clamp(1.7rem, 6vw, 2.65rem); line-height: 1.05; }
.eyebrow, .step-label { letter-spacing: .14em; font-weight: 800; font-size: .72rem; margin: 0; }
.subtitle { color: #d5e2ec; margin: 0; max-width: 700px; line-height: 1.5; }

.shell { width: min(920px, calc(100% - 28px)); margin: -24px auto 40px; position: relative; }
.card, .status-card {
  background: var(--surface);
  border: 1px solid rgba(220, 227, 235, .9);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(18px, 4vw, 28px);
  margin-bottom: 18px;
}
.status-card { font-weight: 650; }
.status-card.info { color: var(--brand); }
.status-card.success { color: var(--success); background: #f2fbf6; border-color: #b9e2c9; }
.status-card.warning { color: var(--warning); background: #fff9eb; border-color: #efd89b; }
.status-card.error { color: var(--danger); background: #fff5f5; border-color: #efb9bd; }

.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { margin: 3px 0 0; font-size: 1.25rem; }
.step-label { color: var(--muted); }
.count-pill { background: var(--soft); color: var(--brand); border-radius: 999px; padding: 7px 11px; font-weight: 750; font-size: .82rem; }

.drop-zone {
  border: 2px dashed #b9c8d6;
  border-radius: 16px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
  background: #fbfdff;
  color: var(--muted);
}
.drop-zone.dragging { border-color: var(--brand); background: var(--soft); }
.drop-zone strong { color: var(--ink); font-size: 1.05rem; }
.drop-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--brand); font-size: 1.7rem; }

.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 12px; margin-top: 16px; }
.preview-card { position: relative; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.preview-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #edf2f7; }
.preview-meta { padding: 9px; }
.preview-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; font-weight: 700; }
.preview-size { color: var(--muted); font-size: .72rem; }
.remove-photo { position: absolute; top: 7px; right: 7px; width: 34px; height: 34px; min-height: 34px; border: 0; border-radius: 50%; background: rgba(17, 24, 39, .78); color: #fff; cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: .87rem; font-weight: 730; }
.full-width { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd8e2;
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 50, 77, .12); }
.required { color: var(--danger); }
.action-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.action-row.centered { justify-content: center; flex-wrap: wrap; }
.primary, .secondary, .link-button {
  border-radius: 11px;
  padding: 11px 17px;
  border: 1px solid transparent;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary { background: var(--brand); color: #fff; }
.primary:hover { background: var(--brand-strong); }
.primary:disabled { opacity: .55; cursor: not-allowed; }
.secondary { background: #fff; color: var(--brand); border-color: #bfcbd6; }
.privacy-note { margin: 14px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }

.success-panel { text-align: center; padding-top: 34px; padding-bottom: 34px; }
.success-mark { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: #e7f7ed; color: var(--success); font-size: 1.9rem; font-weight: 900; }
.success-panel h2 { margin: 0 0 8px; }
.success-panel p { color: var(--muted); }

footer { color: var(--muted); text-align: center; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); font-size: .8rem; }

@media (max-width: 640px) {
  .app-header { padding-bottom: 38px; }
  .shell { width: min(100% - 18px, 920px); }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .action-row { flex-direction: column-reverse; }
  .primary, .secondary, .link-button { width: 100%; }
  #install-button { width: auto; flex: 0 0 auto; }
}
