@font-face {
  font-family: 'Be Vietnam Pro';
  src: url('/assets/be-vietnam-regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Be Vietnam Pro';
  src: url('/assets/be-vietnam-bold.ttf') format('truetype');
  font-weight: 600 900;
  font-display: swap;
}

:root {
  --white: #fff;
  --navy: #15233d;
  --blue: #245eff;
  --blue-hover: #174ddc;
  --muted: #68758e;
  --line: #d2def8;
  --control-line: #8793ab;
  --selected: #f1f5ff;
  --error: #a32d38;
  color-scheme: light;
  font-family: 'Be Vietnam Pro', Arial, sans-serif;
  font-synthesis: none;
  color: var(--navy);
  background: var(--white);
}

* { box-sizing: border-box; }
body { margin: 0; padding-bottom: env(safe-area-inset-bottom); }
button, input { font: inherit; }
button, label, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
[hidden] { display: none !important; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
h1, p { margin: 0; }
button:focus-visible, input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.brand-header {
  display: flex;
  justify-content: center;
  padding: 43px 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.8px;
  white-space: nowrap;
}

.brand img { display: block; flex: none; width: 40px; height: 40px; }

.preferences-main {
  width: min(640px, calc(100% - 52px));
  margin: 51px auto 22px;
}

h1 {
  font-size: clamp(26px, 7.2vw, 30px);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -1.1px;
}

.intro {
  margin-top: 10px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

.category-group { margin-top: 18px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }

.choice {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 60px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -.65px;
  cursor: pointer;
  transition: border-color .16s, background-color .16s;
}

.choice span { min-width: 0; }
.choice:has(input:checked) { background: var(--selected); border-color: #c7d8ff; }
.choice:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }
.choice:has(input:focus-visible) input { outline: none; }
.choice:has(input:disabled) { cursor: wait; }

.choice input {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: block;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
  margin: 0;
  border: 1.5px solid var(--control-line);
  border-radius: 3px;
  background: var(--white);
  cursor: inherit;
}

.choice input[type='checkbox']:checked { border-color: var(--blue); background: var(--blue); }
.choice input[type='checkbox']:checked::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 11px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.choice input[type='radio'] { border-radius: 50%; }
.choice input[type='radio']:checked { border-color: var(--blue); }
.choice input[type='radio']:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--blue);
}

.contact-group { margin-top: 28px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.text-field { min-width: 0; }
.text-field label { display: block; margin-bottom: 9px; font-size: 14px; font-weight: 600; line-height: 1.5; letter-spacing: -.25px; }
.text-field input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--white);
  color: var(--navy);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .16s;
}
.text-field input[aria-invalid='true'] { border-color: var(--error); }
.text-field input:disabled { cursor: wait; opacity: .78; }
.text-field .field-error { margin-top: 7px; font-size: 13px; }
.time-group { margin-top: 32px; }
.time-group legend {
  max-width: 100%;
  padding: 0;
  font-size: clamp(20px, 5.65vw, 24px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.8px;
}
.optional { margin-top: 7px; font-size: 16px; line-height: 1.65; color: var(--muted); }
.times { margin-top: 17px; row-gap: 12px; }
.times .choice { min-height: 56px; gap: 17px; }
.field-error, .submit-message { margin-top: 12px; font-size: 14px; line-height: 1.65; color: var(--error); }

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  width: 100%;
  min-height: 52px;
  padding: 13px 22px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--blue);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -.4px;
  transition: background-color .16s, transform .16s;
}
.submit-button { margin-top: 24px; }
.data-note { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center; }
.primary-button:active:not(:disabled) { transform: translateY(1px); }
.primary-button:disabled { opacity: .78; }
.submit-arrow { flex: none; }
.spinner { width: 20px; height: 20px; border: 2px solid #ffffff66; border-top-color: var(--white); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.success-view { padding: 28px 0 50px; text-align: center; }
.success-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 24px; color: var(--blue); background: var(--selected); border-radius: 50%; }
.success-view h1 { max-width: 520px; margin-inline: auto; }
.success-view h1:focus { outline: none; }
.reset-button { max-width: 338px; margin-top: 32px; }

@media (hover: hover) {
  .choice:hover { border-color: #9fbaff; background: #f8faff; }
  .choice:has(input:checked):hover { background: #eaf0ff; }
  .primary-button:hover:not(:disabled) { background: var(--blue-hover); }
}

@media (min-width: 700px) {
  .brand-header { padding-top: 56px; }
  .preferences-main { margin-top: 54px; margin-bottom: 48px; }
  h1 { font-size: 40px; letter-spacing: -1.5px; }
  .intro { font-size: 18px; margin-top: 12px; }
  .category-group { margin-top: 24px; }
  .choice { min-height: 64px; padding-inline: 20px; font-size: 18px; }
  .contact-group { margin-top: 30px; }
  .text-field label { font-size: 15px; }
  .text-field input { min-height: 56px; padding-inline: 16px; }
  .time-group { margin-top: 34px; }
  .time-group legend { font-size: 26px; }
  .times .choice { min-height: 60px; }
  .primary-button { min-height: 58px; font-size: 19px; }
}

@media (max-width: 374px) {
  .brand-header { padding-top: 34px; }
  .preferences-main { width: calc(100% - 44px); margin-top: 44px; }
  h1 { letter-spacing: -1.15px; }
  .intro { font-size: 16px; }
  .choice { gap: 12px; padding-inline: 12px; font-size: 16px; }
  .times .choice { gap: 12px; }
  .time-group { margin-top: 30px; }
  .optional { font-size: 15px; }
}

@media (forced-colors: active) {
  .choice input { appearance: auto; -webkit-appearance: auto; }
  .choice input::after { display: none; }
  .choice:has(input:checked) { border: 2px solid Highlight; }
  .primary-button { border: 1px solid ButtonText; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
