:root {
  --ink: #182238;
  --muted: #697286;
  --muted-light: #9aa2b2;
  --line: #e6e9f0;
  --paper: #ffffff;
  --canvas: #f6f7fa;
  --navy: #354477;
  --navy-deep: #2c3969;
  --violet: #5549ed;
  --violet-soft: #efedff;
  --orange: #ff9d08;
  --danger: #d94242;
  --success: #16855a;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(28, 39, 76, 0.08);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(85, 73, 237, 0.055), transparent 26rem),
    var(--canvas);
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="file"] + label {
  cursor: pointer;
}

.topbar {
  height: 76px;
  padding: 0 clamp(22px, 4vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.94);
  border-top: 2px solid #eef0f4;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: inherit;
  text-decoration: none;
  line-height: 1;
}

.brand-name {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -1.4px;
}

.brand-mark {
  color: var(--violet);
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0.5px;
}

.brand-sub {
  position: absolute;
  top: 26px;
  left: 1px;
  color: #a5abba;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 1.8px;
  white-space: nowrap;
}

.secure-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.secure-label svg,
.with-icon svg,
.multi-trigger svg,
.submit-button svg,
.upload-icon svg,
.success-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.secure-label svg {
  width: 17px;
  height: 17px;
  color: var(--violet);
}

main {
  width: min(1500px, calc(100% - 40px));
  margin: 44px auto 70px;
}

.hero {
  min-height: 420px;
  padding: 42px clamp(28px, 4.5vw, 64px) 46px;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.025) 0 42%, transparent 42%),
    linear-gradient(120deg, var(--navy-deep), var(--navy));
  border-radius: 18px 18px 0 0;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: 8%;
  top: -225px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgba(255, 255, 255, 0.018), 0 0 0 108px rgba(255, 255, 255, 0.015);
}

.hero-header,
.hero-grid {
  position: relative;
  z-index: 1;
}

.hero-header {
  padding-bottom: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-title-group {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: #b9c1d8;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 2.1px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 3.5vw, 50px);
  line-height: 1.04;
  letter-spacing: -2.2px;
}

.hero h1 span {
  color: #c7cff0;
  font-weight: 500;
}

.role-meta {
  max-width: 520px;
  margin: 0 0 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.role-meta span {
  padding: 7px 11px;
  color: #eff2ff;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.25px;
  white-space: nowrap;
}

.hero-grid {
  padding-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-panel {
  min-width: 0;
  padding: 22px 22px 24px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel-number {
  margin: 0 0 10px;
  color: #9ea9d3;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.4px;
}

.hero-panel h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -0.35px;
}

.hero-panel ul {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  list-style: none;
}

.hero-panel li {
  padding-left: 15px;
  position: relative;
  color: #dbe1f0;
  font-size: 11.5px;
  line-height: 1.48;
}

.hero-panel li::before {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  top: 6px;
  left: 0;
  background: #8f86ff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(143, 134, 255, 0.12);
}

.form-shell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow);
}

#application-form {
  padding: 36px clamp(24px, 4vw, 54px) 44px;
}

.form-intro {
  padding-bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.form-intro .section-kicker {
  margin-bottom: 5px;
  color: var(--violet);
}

.form-intro h2,
.success-state h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.7px;
}

.form-intro > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.required-star,
.field label span {
  color: var(--violet);
}

.form-section {
  min-width: 0;
  margin: 0;
  padding: 31px 0 35px;
  border: 0;
  border-top: 1px solid #edf0f4;
}

.form-section legend {
  width: 100%;
  margin-bottom: 23px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #939baa;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.form-section legend span {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: var(--violet);
  background: var(--violet-soft);
  border-radius: 7px;
  font-size: 9px;
  letter-spacing: 0;
}

.field-grid {
  display: grid;
  gap: 24px 22px;
}

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

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

.field {
  min-width: 0;
}

.field > label:not(.dropzone),
.field > .field-label {
  display: block;
  margin: 0 0 8px;
  color: var(--violet);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.control,
.multi-trigger {
  height: 48px;
  background: #fff;
  border: 1px solid #dfe3eb;
  border-radius: 12px;
  box-shadow: 0 2px 5px rgba(35, 46, 83, 0.025);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.control:focus-within,
.multi-trigger:focus-visible,
.multi-select.open .multi-trigger {
  border-color: rgba(85, 73, 237, 0.72);
  box-shadow: 0 0 0 4px rgba(85, 73, 237, 0.1);
  outline: none;
}

.with-icon {
  display: flex;
  align-items: center;
  padding-left: 13px;
}

.with-icon svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: #a9b0bd;
}

.control input,
.control select {
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  font-weight: 600;
}

.control input::placeholder {
  color: #a8afbb;
  font-weight: 500;
}

.select-control {
  position: relative;
}

.select-control::after {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  top: 18px;
  right: 17px;
  border-right: 1.8px solid #687287;
  border-bottom: 1.8px solid #687287;
  transform: rotate(45deg);
  pointer-events: none;
}

.control select {
  appearance: none;
  padding-right: 40px;
}

.control select:invalid,
.control select:disabled {
  color: #969eac;
}

.multi-select {
  position: relative;
}

.multi-trigger {
  width: 100%;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.multi-trigger:disabled {
  color: #969eac;
  cursor: wait;
}

.multi-trigger svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  transition: transform 160ms ease;
}

.multi-select.open .multi-trigger svg {
  transform: rotate(180deg);
}

.multi-panel {
  width: 100%;
  max-height: 278px;
  padding: 8px;
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 20;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(28, 39, 76, 0.18);
}

.shift-option {
  padding: 10px 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 8px;
  color: #394257;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

.shift-option:hover {
  background: #f5f4ff;
}

.shift-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--violet);
}

.field-hint,
.field-error {
  min-height: 15px;
  margin: 6px 2px 0;
  font-size: 10px;
}

.field-hint {
  color: #8e96a5;
}

.field-error {
  display: none;
  color: var(--danger);
  font-weight: 650;
}

.field.has-error .field-error {
  display: block;
}

.field.has-error .control,
.field.has-error .multi-trigger,
.field.has-error .dropzone {
  border-color: rgba(217, 66, 66, 0.7);
  box-shadow: 0 0 0 3px rgba(217, 66, 66, 0.07);
}

.cv-section {
  padding-bottom: 30px;
}

#cv {
  width: 1px;
  height: 1px;
  position: absolute;
  opacity: 0;
}

.dropzone {
  min-height: 105px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px dashed #cdd3df;
  border-radius: 13px;
  background: #fafbfc;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.dragging {
  background: #f7f6ff;
  border-color: var(--violet);
  transform: translateY(-1px);
}

.upload-icon {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  color: var(--violet);
  background: var(--violet-soft);
  border-radius: 12px;
}

.upload-icon svg {
  width: 23px;
  height: 23px;
}

.upload-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.upload-copy strong {
  overflow: hidden;
  color: #354057;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-copy small {
  color: #929aa8;
  font-size: 10px;
}

.browse-button {
  padding: 10px 15px;
  color: var(--violet);
  background: #fff;
  border: 1px solid #dcdff0;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.35px;
  text-transform: uppercase;
}

.form-footer {
  padding-top: 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  border-top: 1px solid #edf0f4;
}

.form-footer > p {
  max-width: 700px;
  margin: 0;
  color: #89919f;
  font-size: 10px;
  line-height: 1.55;
}

.submit-button,
.secondary-button {
  min-height: 47px;
  border: 0;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.submit-button {
  min-width: 220px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  background: var(--violet);
  box-shadow: 0 9px 20px rgba(85, 73, 237, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.submit-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 13px 28px rgba(85, 73, 237, 0.3);
}

.submit-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

.submit-button svg {
  width: 18px;
  height: 18px;
}

.submit-button.loading svg {
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  stroke: none;
  animation: spin 700ms linear infinite;
}

.form-alert {
  margin-top: 18px;
  padding: 13px 15px;
  color: #992e2e;
  background: #fff3f3;
  border: 1px solid #f2cccc;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
}

.success-state {
  min-height: 520px;
  padding: 80px 30px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.success-state:not([hidden]) {
  display: grid;
}

.success-icon {
  width: 70px;
  height: 70px;
  margin-bottom: 26px;
  display: grid;
  place-items: center;
  color: var(--success);
  background: #e8f7f0;
  border-radius: 50%;
}

.success-icon svg {
  width: 34px;
  height: 34px;
  stroke-width: 2.2;
}

.success-state .section-kicker {
  color: var(--violet);
}

.success-state > p:not(.section-kicker) {
  max-width: 520px;
  margin: 14px 0 28px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.secondary-button {
  padding: 0 22px;
  color: var(--violet);
  background: var(--violet-soft);
}

.honeypot {
  position: fixed !important;
  left: -10000px !important;
}

footer {
  width: min(1500px, calc(100% - 40px));
  margin: -40px auto 35px;
  display: flex;
  justify-content: space-between;
  color: #969eab;
  font-size: 10px;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-header,
  .hero-panel,
  .form-shell {
    animation: reveal 520ms cubic-bezier(.2,.7,.2,1) both;
  }

  .hero-panel:nth-child(1) { animation-delay: 70ms; }
  .hero-panel:nth-child(2) { animation-delay: 105ms; }
  .hero-panel:nth-child(3) { animation-delay: 140ms; }
  .form-shell { animation-delay: 120ms; }

  @keyframes reveal {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 900px) {
  .hero-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }

  .role-meta {
    justify-content: flex-start;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 650px) {
  .topbar {
    height: 68px;
  }

  .secure-label {
    font-size: 0;
  }

  main {
    width: min(100% - 22px, 1500px);
    margin-top: 20px;
  }

  .hero {
    min-height: 0;
    padding: 30px 22px 28px;
  }

  .hero h1 {
    font-size: 34px;
    letter-spacing: -1.5px;
  }

  .hero h1 span {
    display: block;
    margin-top: 4px;
  }

  .hero-header {
    padding-bottom: 24px;
  }

  .role-meta span {
    white-space: normal;
  }

  .hero-grid {
    padding-top: 24px;
    gap: 10px;
  }

  .hero-panel {
    padding: 20px;
  }

  .hero-panel li {
    font-size: 11px;
  }

  #application-form {
    padding: 30px 20px 32px;
  }

  .form-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .field-grid-2,
  .field-grid-3 {
    grid-template-columns: 1fr;
  }

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

  .dropzone {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
  }

  .browse-button {
    width: 100%;
    margin: 3px 0 0;
    grid-column: 1 / -1;
    text-align: center;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .submit-button {
    width: 100%;
  }

  footer {
    width: calc(100% - 32px);
    align-items: center;
    flex-direction: column;
    gap: 7px;
    text-align: center;
  }
}
