:root {
  --brand: #009be2;
  --brand-dark: #0077ad;
  --brand-deep: #005f8c;
  --brand-100: #e2f4fd;
  --coral: #e8724c;
  --coral-dark: #d15f3a;
  --ink: #1c2926;
  --ink-soft: #5b6b67;
  --line: #dbe6e2;
  --card-bg: #ffffff;
  --error: #c94545;
  --radius: 14px;
  --shadow: 0 25px 60px -25px rgba(0, 51, 77, 0.55);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--brand);
  color: var(--ink);
  min-height: 100vh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 60px;
}

.page {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 34px 36px 28px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-dark), var(--coral));
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  border-radius: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--brand-deep);
}

.brand-sub {
  font-size: 12px;
  color: var(--ink-soft);
}

/* Section */
.section {
  border: none;
  padding: 0;
  margin: 0 0 8px;
}

.section h2 {
  margin: 0 0 4px;
  font-size: 21px;
  color: var(--brand-deep);
  letter-spacing: -0.01em;
}

.hint {
  margin: 0 0 20px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.req {
  color: var(--coral-dark);
}

.field {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

input, select, textarea {
  font-family: inherit;
  font-size: 14.5px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: #fbfdfc;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 155, 226, 0.15);
}

input.invalid, select.invalid, textarea.invalid, .multiselect-trigger.invalid {
  border-color: var(--error);
}

.error {
  display: block;
  min-height: 16px;
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
}

.form-error {
  min-height: 0;
  margin: 4px 0 0;
  text-align: right;
}

/* Multi-select dropdown */
.multiselect {
  position: relative;
}

.multiselect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: inherit;
  font-size: 14.5px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: #fbfdfc;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.multiselect-trigger:focus,
.multiselect-trigger.open {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 155, 226, 0.15);
}

.multiselect-trigger span:first-child {
  color: var(--ink-soft);
}

.multiselect-trigger.has-selection span:first-child {
  color: var(--ink);
}

.ms-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: var(--ink-soft);
}

.multiselect-trigger.open .ms-chevron {
  transform: rotate(180deg);
}

.multiselect-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 15px 35px -15px rgba(0, 51, 77, 0.35);
  padding: 6px;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
}

.ms-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}

.ms-option:hover {
  background: var(--brand-100);
}

.ms-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  flex-shrink: 0;
  padding: 0;
}

.official-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.official-note a {
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
}

.official-note a:hover {
  text-decoration: underline;
}

/* Nav row */
.nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.nav-spacer { flex: 1; }

.btn {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 9px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--coral);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(232, 114, 76, 0.6);
}

.btn-primary:hover { background: var(--coral-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--brand-dark);
  border: 1.5px solid var(--line);
}

.btn-ghost:hover { border-color: var(--brand); background: var(--brand-100); }

/* Success view */
.success {
  text-align: center;
  padding: 10px 4px 4px;
}

.success-mark {
  color: var(--brand);
  margin: 0 auto 14px;
  width: 40px;
}

.success h2 {
  margin: 0 0 8px;
  color: var(--brand-deep);
  font-size: 22px;
}

.success p {
  margin: 0 auto 22px;
  max-width: 420px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.official-box {
  background: var(--brand-100);
  border: 1px solid #c2e6f7;
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 22px;
}

.official-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-deep);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 9px;
  transition: background 0.15s ease;
}

.official-link:hover { background: var(--brand-dark); }

/* Responsive */
@media (max-width: 540px) {
  body { padding: 24px 12px 40px; }
  .card { padding: 26px 20px 22px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .card-head { flex-direction: column; align-items: flex-start; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}