:root {
  --brand: #d3202a;
  --brand-dark: #a3161d;
  --brand-tint: #fdeeee;
  --ink: #1f2933;
  --muted: #5f6b7a;
  --line: #d5dbe3;
  --bg: #f4f6f8;
  --card: #ffffff;
  --err: #c62828;
  --note: #fff8e1;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

.top { background: var(--brand); color: #fff; text-align: center; padding: 16px 16px 12px; }
.brand { font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.sub { font-size: 16px; opacity: .95; }
.lock { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 999px; }
.lock svg { width: 14px; height: 14px; fill: #fff; }

.progress { background: var(--card); padding: 10px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.progress-text { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.bar { height: 8px; background: #e6eaef; border-radius: 99px; overflow: hidden; }
.fill { height: 100%; width: 0; background: var(--brand); transition: width .25s; }

main { max-width: 560px; margin: 0 auto; padding: 16px; }
.step { background: var(--card); border-radius: 14px; padding: 20px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
h1 { font-size: 26px; margin: 0 0 12px; }
h2 { font-size: 23px; margin: 0 0 14px; }
h3 { font-size: 19px; margin: 8px 0; }
p { margin: 0 0 12px; }
.small { font-size: 15px; color: var(--muted); }
.big { font-size: 20px; margin-bottom: 4px; }
.note { background: var(--note); border-radius: 10px; padding: 12px; font-size: 16px; margin-bottom: 16px; }
a { color: var(--brand-dark); }
.photo-title { font-size: 22px; font-weight: 800; color: var(--ink); }
.cert { border: 2px solid var(--brand); border-left-width: 8px; background: var(--brand-tint); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 16px; }
.cert p { margin: 0; }
.cert-title { color: var(--brand-dark); font-weight: 800; text-transform: uppercase; font-size: 14px; letter-spacing: .4px; margin-bottom: 4px; }
.ready { margin: 6px 0 0; padding-left: 22px; }
.ready li { margin-bottom: 4px; }

.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-weight: 600; margin-bottom: 6px; padding: 0; }
.opt { font-weight: 400; color: var(--muted); font-size: 15px; }
input[type=text], input[type=email], input[type=tel], select {
  width: 100%;
  font-size: 20px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
input:focus, select:focus { outline: none; border-color: var(--brand); }
.invalid { border-color: var(--err) !important; }
.hint { font-size: 14px; color: var(--muted); margin-top: 4px; }
.err { color: var(--err); font-size: 15px; font-weight: 600; margin-top: 4px; }
.err:empty { display: none; }

.choice { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; border: 2px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.choice input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }

.box { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0 0 18px; background: #fafbfc; }
.box-title { font-weight: 700; margin-bottom: 4px; }
.calc { font-size: 15px; background: var(--brand-tint); border-radius: 8px; padding: 10px; }
.money { display: flex; align-items: center; gap: 8px; font-size: 20px; }

.photo-btn { display: flex; align-items: center; justify-content: center; min-height: 64px; border: 2px dashed var(--brand); border-radius: 12px; color: var(--brand-dark); background: var(--brand-tint); font-weight: 700; text-align: center; padding: 12px; cursor: pointer; }
.preview { display: block; max-width: 100%; max-height: 260px; margin-top: 10px; border-radius: 8px; border: 1px solid var(--line); }

.sig-wrap { position: relative; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
#sig { display: block; width: 100%; height: 180px; touch-action: none; }
.sig-line { position: absolute; left: 16px; right: 16px; bottom: 28px; border-top: 1px solid #b8c1cc; font-size: 13px; color: var(--muted); padding-top: 2px; pointer-events: none; }
.sig-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 15px; color: var(--muted); }

.nav { display: flex; gap: 12px; margin-top: 22px; }
.btn { flex: 1; font-size: 19px; font-weight: 700; padding: 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.small { flex: none; font-size: 15px; padding: 6px 14px; }
.btn.wide { width: 100%; }

.rv-section { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.rv-head { display: flex; justify-content: space-between; align-items: center; background: #f0f3f6; padding: 8px 12px; font-weight: 700; }
.rv-head button { font-size: 15px; font-weight: 700; color: var(--brand-dark); background: none; border: 0; padding: 4px 6px; cursor: pointer; }
.rv-row { padding: 8px 12px; border-top: 1px solid #edf0f3; }
.rv-label { font-size: 14px; color: var(--muted); }
.rv-value { font-size: 17px; word-break: break-word; }
.rv-img { max-width: 120px; max-height: 90px; border-radius: 6px; border: 1px solid var(--line); margin-top: 4px; }

.center { text-align: center; }
.spinner { width: 48px; height: 48px; border: 5px solid #f6d3d5; border-top-color: var(--brand); border-radius: 50%; margin: 20px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.envelope { width: 120px; height: 100px; margin: 8px auto 0; display: block; }
.thanks { font-size: 40px; margin: 6px 0; }
