:root {
  --navy: #002856;      /* Lone Star Blue */
  --navy-2: #013a7a;
  --red: #E02926;       /* Old Glory Red */
  --ink: #0e1726;
  --muted: #5b6b80;
  --line: #e3e8ef;
  --bg: #f4f6f9;
  --card: #ffffff;
  --gradeA: #1a7f4b;
  --gradeB: #b7791f;
  --gradeC: #b45309;
  --reject: #b1231f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 40, 86, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Header */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 18px calc(14px + env(safe-area-inset-top));
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.star { width: 26px; height: 26px; color: #fff; }
.wordmark { font-weight: 800; letter-spacing: 0.06em; font-size: 18px; }
.wordmark em { color: #9fc2ff; font-style: normal; }
.tagline { font-size: 12px; color: #a9c4e6; font-weight: 500; }

.wrap { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; }

/* Steps */
.step { display: none; }
.step.active { display: block; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 16px;
}
.center { text-align: center; }
.stepnum {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--red);
}
h1 { font-size: 24px; margin: 6px 0 6px; }
h2 { font-size: 20px; margin: 14px 0 6px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; line-height: 1.5; }

/* Fields */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
select, input[type="text"] {
  width: 100%; font: inherit; font-size: 16px; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  appearance: none; color: var(--ink);
}
select:focus, input:focus { outline: none; border-color: var(--navy); }

.model-meta {
  background: #f0f5fb; border: 1px solid #dbe7f5; border-radius: 12px;
  padding: 12px 14px; font-size: 13px; color: var(--navy);
  margin-bottom: 16px; line-height: 1.5;
}
.model-meta b { font-weight: 700; }

/* Buttons */
.btn {
  width: 100%; font: inherit; font-weight: 700; font-size: 16px;
  padding: 15px; border-radius: 12px; border: none; cursor: pointer;
  margin-top: 6px;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:disabled { background: #d8b4b3; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn.navy { background: var(--navy); color: #fff; }

/* Photo grid */
.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.shot {
  position: relative; border: 1.5px dashed #c6d2e2; border-radius: 14px;
  aspect-ratio: 1 / 1; overflow: hidden; background: #fafcff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; padding: 10px;
}
.shot.optional { border-style: dotted; }
.shot.filled { border-style: solid; border-color: var(--navy); }
.shot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.shot .icon { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.shot .label { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.shot .hint { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.shot img.thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot .tag {
  position: absolute; left: 6px; bottom: 6px; background: rgba(0,40,86,.85);
  color: #fff; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.shot .flag {
  position: absolute; top: 6px; right: 6px; background: var(--red);
  color: #fff; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 20px;
}
.shot .retake {
  position: absolute; bottom: 6px; right: 6px; background: rgba(255,255,255,.92);
  color: var(--navy); font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 20px;
}

.warning {
  background: #fff4e5; border: 1px solid #f3d19b; color: #7a4b00;
  border-radius: 12px; padding: 11px 14px; font-size: 13px; margin: 6px 0 4px; line-height: 1.45;
}

/* Spinner */
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid #dbe7f5; border-top-color: var(--red);
  margin: 18px auto 6px; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
.grade-hero {
  display: flex; align-items: center; gap: 16px; margin: 8px 0 14px;
}
.grade-badge {
  width: 84px; height: 84px; border-radius: 20px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; font-weight: 800; color: #fff;
}
.grade-badge.A { background: var(--gradeA); }
.grade-badge.B { background: var(--gradeB); }
.grade-badge.C { background: var(--gradeC); }
.grade-badge.REJECT, .grade-badge.NEEDS_REVIEW { background: var(--reject); font-size: 26px; }
.grade-hero .price { font-size: 30px; font-weight: 800; color: var(--navy); }
.grade-hero .glabel { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.grade-hero .est { font-size: 12px; color: var(--muted); }

.disclaimer {
  background: #f0f5fb; border-left: 4px solid var(--navy); border-radius: 8px;
  padding: 12px 14px; font-size: 13px; color: var(--navy); margin: 14px 0; line-height: 1.5;
}
.mismatch {
  background: #fff4e5; border-left: 4px solid var(--red); border-radius: 8px;
  padding: 12px 14px; font-size: 13px; color: #7a4b00; margin: 14px 0; line-height: 1.5;
}
.obs h3, .adj h3 { font-size: 14px; margin: 18px 0 8px; }
.obs ul { margin: 0; padding-left: 18px; }
.obs li { font-size: 14px; color: var(--ink); margin-bottom: 6px; line-height: 1.45; }
.adj-row { font-size: 13px; color: var(--muted); padding: 6px 0; border-top: 1px solid var(--line); }
.adj-row b { color: var(--ink); }
.conf { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.04em; }
.conf.high { background: #e3f4ea; color: var(--gradeA); }
.conf.medium { background: #fbf1dd; color: var(--gradeB); }
.conf.low { background: #fde6e5; color: var(--reject); }

.contact-box { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.success {
  background: #e3f4ea; border: 1px solid #b6e0c6; color: var(--gradeA);
  border-radius: 12px; padding: 16px; text-align: center; font-weight: 600; margin-top: 14px;
}

.foot { text-align: center; font-size: 11px; color: var(--muted); padding: 20px 16px 30px; }

/* iOS: prevent input-focus zoom (font-size already 16px above) */
