:root {
  --background: #11170d;
  --surface: #16261c;
  --input: #162218;
  --border: #38473d;
  --text-primary: #f6f6f6;
  --text-secondary: #d5d7d6;
  --placeholder: #7d837f;
  --accent: #8fd7af;
  --button-start: #c4fa82;
  --button-middle: #d5fba6;
  --button-end: #e1ffb8;
  --button-text: #141414;
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --panel: var(--surface);
  --field: var(--input);
  --line: var(--border);
  --line-strong: var(--border);
  --accent-soft: var(--accent);
  --danger: #ff8585;
  --danger-bg: rgba(255, 96, 96, 0.08);
  --radius: 12px;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  background: var(--background);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(17, 23, 13, 0.16), rgba(17, 23, 13, 0.34)),
    url("./pics/20260703-160936.jpg") center / cover fixed;
  font-family:
    "Segoe UI Variable",
    "Aptos",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.apply-page {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 96px;
}

.brand {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  color: var(--text-secondary);
  font-size: 22px;
  letter-spacing: 0.02em;
}

.brand-cn {
  color: var(--text-primary);
}

.brand strong {
  color: var(--text-primary);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.brand-logo {
  display: block;
  width: auto;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 31px;
  height: 31px;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 5px;
  transform: rotate(-4deg);
}

.brand-mark i {
  display: block;
  border-radius: 2px;
  background: var(--text-primary);
}

.brand-mark i:nth-child(2),
.brand-mark i:nth-child(3) {
  transform: translateX(5px);
}

.brand-divider {
  width: 1px;
  height: 32px;
  margin: 0 8px;
  background: var(--text-primary);
}

.language-toggle {
  display: inline-flex;
  min-width: 82px;
  min-height: 44px;
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid rgba(246, 246, 246, 0.22);
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  color: var(--text-primary);
  background: rgba(22, 38, 28, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(14px);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.language-toggle:hover {
  border-color: rgba(143, 215, 175, 0.62);
  background: rgba(31, 52, 39, 0.88);
  transform: translateY(-1px);
}

.language-toggle:focus-visible {
  outline: 3px solid rgba(143, 215, 175, 0.32);
  outline-offset: 3px;
}

.language-toggle-option {
  opacity: 0.48;
  transition: opacity 160ms ease;
}

.language-toggle-option.is-active {
  color: var(--button-start);
  opacity: 1;
}

.language-toggle-divider {
  width: 1px;
  height: 14px;
  background: rgba(246, 246, 246, 0.24);
}

.application-card {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 4vw, 64px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(246, 246, 246, 0.035), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px) saturate(118%);
}

.application-card::before {
  position: absolute;
  top: -220px;
  left: -160px;
  width: 500px;
  height: 420px;
  border-radius: 50%;
  background: rgba(143, 215, 175, 0.1);
  filter: blur(50px);
  pointer-events: none;
  content: "";
}

.card-heading,
form {
  position: relative;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.card-heading h1 {
  margin: 0;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 560;
  letter-spacing: -0.055em;
  line-height: 1;
}

.card-heading h1 .title-accent {
  color: var(--accent-soft);
}

.card-heading > p:last-child {
  max-width: 670px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

form {
  margin-top: 44px;
}

.form-section {
  padding: 34px 0 38px;
  border-top: 1px solid var(--line);
}

.form-section--optional {
  padding-bottom: 30px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}

.section-title span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.section-title h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  gap: 26px;
}

.field-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.form-field > label,
.form-field > legend {
  display: block;
  margin-bottom: 11px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 650;
}

.form-field > label span,
.form-field > legend span {
  color: var(--accent);
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  height: 62px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  outline: 0;
  color: var(--text-primary);
  background: var(--field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input[type="text"],
input[type="email"] {
  padding: 0 20px;
}

select {
  appearance: none;
  padding: 0 54px 0 20px;
}

.select-wrap {
  position: relative;
  max-width: calc(50% - 13px);
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  content: "";
}

select:invalid {
  color: var(--placeholder);
}

select option {
  color: var(--text-primary);
  background: var(--surface);
}

input::placeholder {
  color: var(--placeholder);
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  border-color: var(--accent);
  background: var(--input);
  box-shadow: 0 0 0 4px rgba(143, 215, 175, 0.12);
}

.use-case-field {
  margin-top: 36px;
}

.multi-select {
  position: relative;
  display: block;
  max-width: calc(50% - 13px);
}

.multi-select summary {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 0 54px 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
  background: var(--input);
}

.multi-select summary::-webkit-details-marker {
  display: none;
}

.multi-select summary::after {
  position: absolute;
  top: 50%;
  right: 22px;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--text-secondary);
  border-bottom: 1.5px solid var(--text-secondary);
  content: "";
  transform: translateY(-68%) rotate(45deg);
  transition: transform 160ms ease;
}

.multi-select[open] summary::after {
  transform: translateY(-25%) rotate(225deg);
}

.multi-select-menu {
  position: absolute;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-height: 320px;
  margin-top: 8px;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.24);
}

.multi-select-menu label {
  position: relative;
  display: flex;
  min-height: 54px;
  margin: 0;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text-secondary);
  background: var(--input);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.multi-select-menu input {
  width: 17px;
  height: 17px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.multi-select-menu label:has(input:checked) {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--surface);
}

.multi-select-menu label:has(input:focus-visible) {
  outline: 3px solid rgba(143, 215, 175, 0.26);
  outline-offset: 2px;
}

.field-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.45;
}

.form-field.is-invalid > label,
.form-field.is-invalid > legend {
  color: var(--danger);
}

.form-field.is-invalid input[type="text"],
.form-field.is-invalid input[type="email"],
.form-field.is-invalid select {
  border-color: var(--danger);
  background: var(--danger-bg);
  box-shadow: 0 0 0 3px rgba(255, 133, 133, 0.08);
}

.form-field.is-invalid .multi-select summary {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.submit-row {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) 1fr;
  align-items: center;
  gap: 42px;
  padding-top: 8px;
}

.submit-row button {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border: 0;
  border-radius: 18px;
  color: var(--button-text);
  background: linear-gradient(
    100deg,
    var(--button-start),
    var(--button-middle) 52%,
    var(--button-end)
  );
  box-shadow: 0 16px 38px rgba(143, 215, 175, 0.18);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.submit-label {
  font-size: 20px;
  font-weight: 800;
}

.submit-arrow {
  font-size: 30px;
  font-weight: 400;
}

.submit-row button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 46px rgba(143, 215, 175, 0.28);
  filter: brightness(1.04);
}

.submit-row button:focus-visible {
  outline: 4px solid rgba(143, 215, 175, 0.32);
  outline-offset: 4px;
}

.submit-row button:disabled {
  cursor: wait;
  filter: saturate(0.55) brightness(0.76);
}

.submit-row p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.form-message {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 133, 133, 0.35);
  border-radius: 10px;
  color: #ffd2d2;
  background: rgba(82, 13, 13, 0.42);
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

/* Wide desktop composition follows the exhibition demo: the brand sits just
   outside the glass panel, with lighter display typography and more air above
   the form. Tablet and mobile keep the denser layout below. */
@media (min-width: 1180px) {
  .apply-page {
    width: min(1480px, calc(100% - clamp(160px, 18vw, 320px)));
    padding: 56px 0 112px;
  }

  .brand {
    min-height: 54px;
    gap: 18px;
    margin: 0 0 54px -56px;
    font-family:
      "Segoe UI Variable Display",
      "Aptos Display",
      "PingFang SC",
      "Microsoft YaHei UI",
      sans-serif;
    font-size: 31px;
    font-weight: 390;
    letter-spacing: 0.035em;
  }

  .brand strong {
    font-size: 39px;
    font-weight: 430;
    letter-spacing: -0.025em;
  }

  .brand-cn {
    font-weight: 350;
    letter-spacing: 0.075em;
  }

  .brand-logo {
    width: auto;
    height: 44px;
  }

  .brand-divider {
    height: 40px;
    margin: 0 13px;
    background: var(--text-primary);
  }

  .application-card {
    padding: clamp(56px, 4.2vw, 72px);
    border-radius: 34px;
  }

  .card-heading h1 {
    font-size: clamp(52px, 3.7vw, 64px);
    font-weight: 470;
    letter-spacing: -0.045em;
  }

  .card-heading > p:last-child {
    margin-top: 18px;
    font-size: 17px;
  }
}

@media (max-width: 1080px) {
  .multi-select-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    background-image:
      linear-gradient(180deg, rgba(17, 23, 13, 0.2), rgba(17, 23, 13, 0.38)),
      url("./pics/20260703-160912.jpg");
  }

  .apply-page {
    width: min(100% - 24px, 560px);
    padding: max(18px, env(safe-area-inset-top)) 0 56px;
  }

  .brand {
    gap: 10px;
    margin: 0 6px 18px;
    font-size: 16px;
  }

  .brand strong {
    font-size: 23px;
  }

  .brand-logo {
    width: auto;
    height: 28px;
    max-width: 130px;
  }

  .brand-divider {
    height: 25px;
    margin: 0 3px;
  }

  .language-toggle {
    min-width: 70px;
    min-height: 40px;
    padding: 4px 7px;
  }

  .application-card {
    padding: 27px 20px 30px;
    border-radius: 20px;
  }

  .card-heading h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .card-heading > p:last-child {
    margin-top: 15px;
    font-size: 15px;
  }

  form {
    margin-top: 32px;
  }

  .form-section {
    padding: 27px 0 31px;
  }

  .field-grid--two,
  .submit-row {
    grid-template-columns: 1fr;
  }

  .select-wrap {
    max-width: none;
  }

  .multi-select {
    max-width: none;
  }

  .multi-select-menu {
    grid-template-columns: 1fr;
  }

  .submit-row {
    gap: 15px;
  }

  .submit-row button {
    min-height: 68px;
    padding: 0 23px;
  }
}

@media (max-width: 420px) {
  .brand-cn,
  .brand-divider {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
