:root {
  --orange: #ec652d;
  --orange-dark: #c94f1c;
  --ink: #222222;
  --muted: #5f5f5f;
  --line: #d6d6d6;
  --bg: #f3f3f1;
  --card: #ffffff;
  --critical: #b42318;
  --critical-bg: #fdecea;
  --notice-bg: #fff4ec;
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.site-header {
  background: var(--card);
  border-bottom: 4px solid var(--orange);
  padding: 14px 16px;
  text-align: center;
}

.site-header img {
  height: 42px;
  width: auto;
}

.page {
  max-width: 720px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 12px;
  text-align: center;
}

h2 {
  font-size: 1.05rem;
  margin: 32px 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--orange);
}

.intro {
  color: var(--muted);
  margin: 0 0 8px;
}

.fixed {
  margin: 0 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fixed div {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.fixed dt {
  font-size: 0.8rem;
  color: var(--muted);
}

.fixed dd {
  margin: 0;
  font-weight: bold;
  font-size: 1.05rem;
}

.field {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

label,
legend,
.label {
  display: block;
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 6px;
  padding: 0;
}

input[type='text'],
input[type='email'],
input[type='tel'],
select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #a9a9a9;
  border-radius: var(--radius);
  padding: 10px 12px;
  min-height: 44px;
}

input:focus,
select:focus,
button:focus-visible,
.upload-button:focus-within,
canvas:focus-visible {
  outline: 3px solid rgba(236, 101, 45, 0.45);
  outline-offset: 1px;
  border-color: var(--orange);
}

.field:has(.error:not([hidden])) input,
.field:has(.error:not([hidden])) select {
  border-color: var(--critical);
}

.hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 4px 0 8px;
}

.error {
  color: var(--critical);
  font-size: 0.875rem;
  margin: 6px 0 0;
}

.notice {
  background: var(--notice-bg);
  border-left: 4px solid var(--orange);
  padding: 10px 12px;
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  border: 1px solid #a9a9a9;
  border-radius: var(--radius);
  padding: 9px 14px;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
}

.choice:has(input:checked) {
  border-color: var(--orange);
  background: var(--notice-bg);
}

.choice input {
  accent-color: var(--orange);
  width: 18px;
  height: 18px;
  margin: 0;
}

.expiry {
  display: flex;
  align-items: center;
  gap: 8px;
}

.expiry select {
  width: auto;
  min-width: 84px;
}

.upload {
  border: 1px dashed #a9a9a9;
  border-radius: var(--radius);
  padding: 14px;
}

.upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid var(--orange);
  border-radius: var(--radius);
  color: var(--orange-dark);
  font-weight: bold;
  cursor: pointer;
  margin: 0;
}

.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.preview {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin-top: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.card-illustration {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 4px 0 8px;
}

.declaration {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 4px 16px;
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: normal;
  margin: 10px 0 0;
  cursor: pointer;
}

.check input {
  accent-color: var(--orange);
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: none;
}

.check + .error {
  margin: 4px 0 0 30px;
}

.signature-field {
  margin-top: 24px;
}

.signature-pad {
  position: relative;
}

.signature-pad canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  background: #fff;
  border: 1px solid #a9a9a9;
  border-radius: var(--radius);
  touch-action: none;
  cursor: crosshair;
  /* Signature line */
  background-image: linear-gradient(#bdbdbd, #bdbdbd);
  background-size: calc(100% - 40px) 1px;
  background-position: 20px 75%;
  background-repeat: no-repeat;
}

.link-button {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.85rem;
  padding: 4px 10px;
  cursor: pointer;
}

.static-value {
  margin: 0;
  padding: 10px 0;
}

.privacy {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 20px 0;
}

.submit {
  display: block;
  width: 100%;
  min-height: 52px;
  background: var(--orange);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1.05rem;
  font-weight: bold;
  cursor: pointer;
}

.submit:hover {
  background: var(--orange-dark);
}

.submit:disabled {
  opacity: 0.65;
  cursor: progress;
}

.banner {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
  font-weight: bold;
}

.banner-critical {
  background: var(--critical-bg);
  color: var(--critical);
  border: 1px solid #f3b8b1;
}

.message {
  text-align: center;
}

.message p {
  margin: 10px 0;
}

.site-footer {
  max-width: 720px;
  margin: 0 auto 32px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.site-footer p {
  margin: 4px 0;
}

@media (max-width: 560px) {
  .card {
    padding: 22px 16px;
  }

  .row,
  .fixed {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.3rem;
  }
}
