:root {
  color-scheme: light;
  --blue: #123d75;
  --blue-strong: #0b2e5d;
  --blue-soft: #eaf2fb;
  --red: #e82f45;
  --ink: #172033;
  --muted: #607087;
  --line: #d8e0e9;
  --surface: #ffffff;
  --background: #f3f6f9;
  --success: #16744a;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--background);
  letter-spacing: 0;
}

button, textarea, input { font: inherit; letter-spacing: 0; }

.brand {
  min-height: 92px;
  background: var(--blue);
  border-top: 8px solid var(--red);
  display: flex;
  align-items: center;
}

.brand__inner {
  width: min(100% - 40px, 760px);
  margin: 0 auto;
}

.brand img {
  display: block;
  width: min(100%, 332px);
  height: auto;
}

.page {
  width: min(100% - 40px, 760px);
  margin: 0 auto;
  padding: 52px 0 72px;
}

h1 {
  max-width: 680px;
  margin: 0 0 16px;
  color: var(--blue-strong);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  font-weight: 760;
}

.lead {
  max-width: 650px;
  margin: 0 0 32px;
  color: #3f5067;
  font-size: 1.08rem;
  line-height: 1.6;
}

.context {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 38px;
  padding: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.context > div {
  min-width: 0;
  padding: 18px 20px;
  border-left: 1px solid var(--line);
}

.context > div:first-child,
.context > .context__primary { border-left: 0; }

.context > .context__primary {
  grid-column: 1 / -1;
  padding: 20px;
  color: var(--surface);
  background: var(--blue);
}

.context dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.context__primary dt { color: #c9dcf3; }

.context dd {
  overflow-wrap: anywhere;
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
}

.context__primary dd { font-size: 1.22rem; }

.field-label,
.photos legend {
  display: block;
  margin: 0 0 10px;
  color: var(--blue-strong);
  font-size: 1rem;
  font-weight: 750;
}

.field-label span { color: var(--red); }

textarea {
  display: block;
  width: 100%;
  min-height: 142px;
  resize: vertical;
  padding: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #bbc7d4;
  border-radius: 6px;
  outline: none;
  line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea::placeholder { color: #8794a5; }
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 61, 117, .14);
}

textarea[aria-invalid="true"] { border-color: var(--red); }

.photos {
  margin: 30px 0 0;
  padding: 0;
  border: 0;
}

.upload {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px dashed #9eafc2;
  border-radius: 6px;
  cursor: pointer;
}

.upload:hover { border-color: var(--blue); background: #f9fbfe; }

.upload__icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--blue);
  border-radius: 50%;
  font-size: 1.65rem;
  line-height: 1;
}

.upload strong,
.upload small { display: block; }
.upload strong { margin-bottom: 4px; color: var(--blue-strong); }
.upload small { color: var(--muted); }

#photos {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.photo-note,
.afterword {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
}

.previews {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.preview {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--blue-soft);
}

.preview img { width: 100%; height: 100%; object-fit: cover; }

.preview button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--surface);
  background: rgba(15, 29, 49, .86);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
}

.field-error,
.form-error {
  min-height: 20px;
  margin: 7px 0 0;
  color: #b42334;
  font-size: .88rem;
}

.form-error { margin: 16px 0 0; }

.field-meta {
  min-height: 28px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.field-meta .field-error { flex: 1; }

#character-count {
  flex: 0 0 auto;
  margin-top: 7px;
  color: var(--muted);
  font-size: .82rem;
}

.submit,
.secondary {
  width: 100%;
  min-height: 56px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 750;
}

.submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 20px;
  color: var(--surface);
  background: var(--red);
  border: 0;
}

.submit:hover { background: #cc2035; }
.submit:disabled { cursor: wait; opacity: .7; }
.submit__arrow { font-size: 1.45rem; }

.fallback {
  display: inline-block;
  margin-top: 22px;
  color: var(--blue);
  font-weight: 700;
}

.loading {
  min-height: 280px;
  padding-top: 28px;
}

.loading__line {
  display: block;
  width: min(100%, 520px);
  height: 26px;
  margin-bottom: 14px;
  background: #dfe6ee;
  border-radius: 4px;
  animation: loading-pulse 1.2s ease-in-out infinite alternate;
}

.loading__line--short { width: min(72%, 380px); }
.loading p { margin-top: 32px; color: var(--muted); }

@keyframes loading-pulse {
  from { opacity: .55; }
  to { opacity: 1; }
}

.result {
  max-width: 620px;
  padding-top: 24px;
}

.result__mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: var(--surface);
  background: var(--success);
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 800;
}

.result__mark--error { background: var(--red); }

.result__eyebrow {
  margin: 0 0 8px;
  color: var(--success);
  font-weight: 800;
  text-transform: uppercase;
}

.result__number {
  display: block;
  margin: 12px 0;
  color: var(--blue-strong);
  font-size: 2.1rem;
}

.result__body {
  color: #3f5067;
  font-size: 1.08rem;
  line-height: 1.55;
}

.result__note { color: var(--muted); }

.secondary {
  margin-top: 22px;
  color: var(--blue);
  background: var(--surface);
  border: 1px solid var(--blue);
}

.honeypot { position: absolute; left: -10000px; }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  .brand { min-height: 76px; }
  .brand__inner, .page { width: min(100% - 28px, 760px); }
  .brand img { width: 260px; }
  .page { padding: 36px 0 52px; }
  h1 { font-size: 2rem; }
  .lead { font-size: 1rem; }
  .context { grid-template-columns: 1fr 1fr; }
  .context > div { padding: 14px; }
  .context > div:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .context > div:nth-child(3) { border-top: 1px solid var(--line); }
  .previews { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
