:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --panel: #ffffff;
  --ink: #16191d;
  --muted: #65707a;
  --line: #d9dedf;
  --accent: #07546c;
  --accent-2: #2f7d5d;
  --soft: #eef6f3;
  --danger: #b3261e;
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  margin: 0;
}

.app-shell {
  min-height: 100svh;
  padding: 18px;
  display: grid;
  place-items: start center;
}

.panel {
  width: min(760px, 100%);
  background: var(--panel);
  border: 1px solid rgba(12, 40, 48, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(20, 32, 36, 0.10);
  padding: clamp(18px, 4vw, 34px);
}

.heading {
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-size: 0.8rem;
  font-weight: 750;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 6vw, 2.6rem);
  line-height: 1.04;
  letter-spacing: 0;
}

form {
  display: grid;
  gap: 16px;
}

.section-title {
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 650;
}

label span {
  font-size: 0.94rem;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

input:focus,
button:focus,
canvas:focus {
  outline: 3px solid rgba(7, 84, 108, 0.22);
  outline-offset: 2px;
}

.field-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.notice {
  border-left: 4px solid var(--accent-2);
  background: var(--soft);
  padding: 14px 15px;
  line-height: 1.45;
  border-radius: 6px;
}

.check-row {
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.check-row input {
  min-height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.signature-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.signature-head {
  min-height: 46px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

canvas {
  display: block;
  width: 100%;
  height: 210px;
  touch-action: none;
  background:
    linear-gradient(transparent 86%, rgba(7, 84, 108, 0.22) 86%, rgba(7, 84, 108, 0.22) 87%, transparent 87%),
    #fff;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:disabled {
  opacity: 0.62;
  cursor: wait;
}

.ghost {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
}

.status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--accent-2);
}

@media (max-width: 620px) {
  .app-shell {
    padding: 0;
  }

  .panel {
    min-height: 100svh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .field-pair {
    grid-template-columns: 1fr;
  }
}
