:root {
  --brand: #233473;
  --error: #b32328;
  --muted: #5f666f;
  --line: rgba(0, 0, 0, 0.10);
  color-scheme: light;
  color: #1c1c1c;
  background: #fff;
  font: 14px/20px -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.page-shell {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.page-footer {
  margin-top: auto;
  padding: 0 16px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  margin: 0 -16px 16px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  word-wrap: break-word;
}

.eyebrow,
.code-block label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.panel {
  padding: 24px;
  border-radius: 16px;
  background: #f7f9fb;
}

.device-photo {
  margin-top: 12px;
  padding: 8px 12px;
}

.device-photo img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto;
}

.expiry-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 16px 0;
  padding: 16px;
  background: rgba(229, 236, 246, 0.5);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.expiry-line time {
  margin-left: 12px;
  color: #1c1c1c;
  font-variant-numeric: tabular-nums;
}

.usage-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.usage-note strong {
  display: block;
  margin-bottom: 4px;
  color: #1c1c1c;
  font-weight: 600;
}

.primary-button {
  width: 100%;
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--brand);
  font-size: 18px;
  line-height: 28px;
  font-weight: 600;
  cursor: pointer;
}

.primary-button:active {
  filter: brightness(0.9);
}

.info-panel .primary-button {
  margin-top: 24px;
}

.primary-button:disabled {
  color: var(--muted);
  background: rgba(0, 0, 0, 0.05);
  cursor: default;
}

.primary-button:focus,
input:focus,
textarea:focus {
  outline: 2px solid #5269b4;
  outline-offset: 2px;
}

.section-heading {
  margin-bottom: 16px;
}

.form-message:not(:empty),
.state-note {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 0 16px var(--line);
  background: #fff;
  color: var(--error);
  font-size: 14px;
  line-height: 20px;
}

.state-note {
  margin-top: 8px;
}

.form-message:not(:empty) {
  position: sticky;
  top: 8px;
  z-index: 1;
  margin-bottom: 16px;
}

.field,
.field-group {
  min-width: 0;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.field label,
.field-group legend {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.required {
  margin-left: 4px;
  color: var(--error);
  font-size: 12px;
  font-weight: 400;
}

[data-error-for] {
  margin-top: 4px;
  color: var(--error);
}

input[type="text"],
input[type="date"],
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 16px;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 8px;
  background: #fff;
  color: #1c1c1c;
  font-size: 16px;
  line-height: 20px;
}

textarea {
  resize: vertical;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-gap: 8px;
}

.choice-row label {
  position: relative;
  cursor: pointer;
}

.choice-row span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 4px 8px;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.choice-row input {
  position: absolute;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-row span::after {
  content: "";
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 50%;
}

.choice-row input:checked + span {
  background: #f7f9fb;
  box-shadow: inset 0 0 0 2px var(--brand);
}

.choice-row input:checked + span::after {
  border-color: var(--brand);
  background: var(--brand);
}

.choice-row input:checked + span::before {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 3px;
  height: 6px;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: translateY(-60%) rotate(45deg);
}

.choice-row input:focus + span {
  outline: 2px solid #5269b4;
  outline-offset: 2px;
}

input.condition-detail {
  margin-top: 8px;
}

.success-panel {
  text-align: center;
}

.success-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #a1e3cb;
  color: #287159;
  font-size: 24px;
  line-height: 44px;
}

.success-panel h1 + p {
  margin-top: 8px;
  color: var(--muted);
}

.code-block {
  margin-top: 24px;
  padding: 16px;
  border-radius: 8px;
  background: rgba(229, 236, 246, 0.5);
}

.arrival-code {
  display: block;
  color: var(--brand);
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 36px;
  word-break: break-all;
}

@media (min-width: 380px) {
  .condition-field .choice-row {
    grid-template-columns: 1fr 1.25fr 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .page-header {
    min-height: 52px;
    padding: 8px 12px;
  }

  .panel {
    padding: 16px;
  }
}
