.application-page {
  min-height: 100vh;
  background: var(--surface);
}

.application-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 0 32px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.application-header .wordmark-main {
  color: var(--ink);
}

.application-header-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #5f5f63;
  font-size: 12px;
}

.light-language-control {
  color: var(--ink);
  border-color: #bebec1;
}

.light-language-control .language-select option {
  background: var(--white);
}

.application-shell {
  display: grid;
  grid-template-columns: minmax(340px, 0.76fr) minmax(600px, 1.24fr);
  min-height: calc(100vh - 96px);
}

.application-context {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 42px max(42px, calc((100vw - 1240px) / 2));
  overflow: hidden;
  background: var(--black);
  color: var(--white);
}

.application-context::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.78)), url('/assets/audi-r26.jpg') center / cover;
  content: "";
  filter: saturate(0.5) brightness(0.5);
  opacity: 0.48;
}

.application-context > * {
  position: relative;
  z-index: 1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 9px;
  color: #d7d7da;
  font-size: 12px;
}

.back-link svg {
  width: 16px;
}

.context-content {
  margin: auto 0;
  padding: 64px 0 48px;
}

.context-content h1 {
  max-width: 570px;
  margin: 0;
  font-size: 52px;
  font-weight: 500;
  line-height: 1.02;
}

.context-content > p:last-of-type {
  max-width: 560px;
  margin: 26px 0 0;
  color: #d0d0d3;
  line-height: 1.7;
}

.invitation-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 600px;
  margin-top: 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.invitation-status > div {
  min-width: 0;
  padding: 17px 16px 17px 0;
}

.invitation-status > div + div {
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.invitation-status small,
.invitation-status strong {
  display: block;
}

.invitation-status small {
  margin-bottom: 8px;
  color: #98989c;
  font-size: 9px;
  text-transform: uppercase;
}

.invitation-status strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #f2f2f3;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.invitation-status svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: #e62536;
}

.context-event {
  display: grid;
  gap: 18px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.context-event > div {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 13px;
}

.context-event svg {
  width: 18px;
  margin-top: 2px;
  color: #d1d1d3;
}

.context-event span,
.context-event small,
.context-event strong {
  display: block;
}

.context-event small {
  margin-bottom: 2px;
  color: #96969a;
  font-size: 9px;
  text-transform: uppercase;
}

.context-event strong {
  font-size: 13px;
  font-weight: 500;
}

.context-privacy {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 28px 0 0;
  color: #a2a2a7;
  font-size: 10px;
  line-height: 1.5;
}

.context-privacy svg {
  flex: 0 0 auto;
  width: 16px;
}

.form-workspace {
  min-width: 0;
  padding: 54px max(48px, calc((100vw - 1240px) / 2));
  background: var(--white);
}

.form-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.form-kicker {
  margin: 0 0 6px;
  color: var(--red-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.form-topline h2,
.success-panel h2 {
  margin: 0;
  font-size: 31px;
  font-weight: 500;
  line-height: 1.15;
}

.step-count {
  flex: 0 0 auto;
  color: #9a9a9d;
  font-size: 14px;
}

.step-count span:first-child {
  color: var(--ink);
  font-size: 24px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 32px 0 44px;
  padding: 0;
  list-style: none;
}

.stepper li {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-top: 14px;
  border-top: 2px solid #d8d8da;
  color: #8b8b8e;
}

.stepper li::after {
  position: absolute;
  top: -2px;
  right: 100%;
  left: 0;
  height: 2px;
  background: var(--red);
  content: "";
  transition: right 220ms ease;
}

.stepper li.is-active,
.stepper li.is-complete {
  color: var(--ink);
}

.stepper li.is-active::after,
.stepper li.is-complete::after {
  right: 0;
}

.stepper li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #e9e9ea;
  border-radius: 50%;
  font-size: 11px;
}

.stepper li.is-active > span,
.stepper li.is-complete > span {
  background: var(--ink);
  color: var(--white);
}

.stepper small {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-alert {
  margin-bottom: 24px;
  padding: 13px 15px;
  background: #fff0f1;
  border-left: 3px solid var(--red);
  color: #7f0011;
  font-size: 13px;
}

.form-step {
  animation: step-in 220ms ease both;
}

.form-step[hidden] {
  display: none;
}

.step-heading {
  max-width: 660px;
  margin-bottom: 30px;
}

.step-heading > span {
  color: var(--red-dark);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.step-heading h3 {
  margin: 7px 0 9px;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.step-heading p {
  margin: 0;
  color: #656569;
  font-size: 14px;
  line-height: 1.6;
}

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

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

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.field > span {
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #b7b7ba;
  border-radius: 2px;
  background: var(--white);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input {
  height: 48px;
  padding: 0 13px;
}

.field textarea {
  min-height: 86px;
  padding: 12px 13px;
  line-height: 1.5;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(23, 23, 25, 0.08);
}

.field.has-error input,
.field.has-error textarea {
  border-color: var(--red);
}

.field-wide {
  grid-column: 1 / -1;
}

.phone-code {
  grid-column: span 1;
}

.phone-number {
  grid-column: span 1;
}

.field-error {
  display: block;
  min-height: 16px;
  color: var(--red-dark);
  font-size: 10px;
  font-style: normal;
}

.document-notice {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  margin-bottom: 26px;
  padding: 15px 16px;
  background: #f1f1f2;
  border-left: 3px solid var(--ink);
}

.document-notice svg {
  width: 19px;
  margin-top: 1px;
}

.document-notice p {
  margin: 0;
  color: #555559;
  font-size: 12px;
  line-height: 1.55;
}

.review-summary {
  border-top: 1px solid var(--ink);
}

.review-group {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.review-group > span {
  color: #77777b;
  font-size: 11px;
  text-transform: uppercase;
}

.review-group strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.review-group small {
  display: block;
  margin-top: 4px;
  color: #77777b;
}

.consent-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.checkbox-field {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 15px 16px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--red);
}

.checkbox-field strong,
.checkbox-field small {
  display: block;
}

.checkbox-field strong {
  font-size: 12px;
}

.checkbox-field small {
  margin-top: 4px;
  color: #69696d;
  line-height: 1.5;
}

.checkbox-field .field-error {
  min-height: 0;
  margin-top: 4px;
}

.submission-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 20px 0 0;
  color: #67676b;
  font-size: 11px;
  line-height: 1.5;
}

.submission-note svg {
  flex: 0 0 auto;
  width: 16px;
}

.form-actions {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.button-secondary {
  border-color: #a9a9ac;
  background: var(--white);
  color: var(--ink);
}

.button-secondary svg {
  margin-right: 10px;
  margin-left: 0;
}

.text-cancel {
  justify-self: start;
  padding: 10px;
  color: #77777b;
  font-size: 12px;
}

.form-actions [data-next],
.form-actions [data-submit] {
  grid-column: 3;
}

.button[disabled] {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.success-panel {
  max-width: 620px;
  padding-top: 44px;
  animation: step-in 260ms ease both;
}

.success-panel[hidden] {
  display: none;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  margin-bottom: 32px;
  background: var(--green);
  border-radius: 50%;
  color: var(--white);
}

.success-icon svg {
  width: 26px;
  height: 26px;
}

.success-panel > p:not(.form-kicker) {
  max-width: 550px;
  margin: 18px 0 0;
  color: #646468;
  line-height: 1.65;
}

.reference-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 14px;
  padding: 18px 20px;
  background: #f1f1f2;
}

.reference-block span {
  color: #77777b;
  font-size: 11px;
  text-transform: uppercase;
}

.reference-block strong {
  font-size: 18px;
}

.email-status {
  margin: 0 0 28px;
  padding: 13px 15px;
  border-left: 3px solid var(--green);
  background: #eaf6f2;
  color: #155e4c;
  font-size: 12px;
  line-height: 1.5;
}

.email-status.is-demo {
  border-left-color: var(--amber);
  background: #fff5df;
  color: #704300;
}

.email-status.is-failed {
  border-left-color: var(--red);
  background: #fff0f1;
  color: #7f0011;
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1050px) {
  .application-shell {
    grid-template-columns: minmax(300px, 0.7fr) minmax(520px, 1.3fr);
  }

  .application-context {
    padding-right: 36px;
    padding-left: 36px;
  }

  .context-content h1 {
    font-size: 43px;
  }

  .form-workspace {
    padding-right: 36px;
    padding-left: 36px;
  }
}

@media (max-width: 820px) {
  .application-header {
    min-height: 66px;
    padding: 0 16px;
  }

  .application-header-meta > span {
    display: none;
  }

  .application-shell {
    display: block;
  }

  .application-context {
    min-height: 460px;
    padding: 28px 24px 34px;
  }

  .context-content {
    margin: 60px 0 auto;
    padding: 0 0 50px;
  }

  .context-content h1 {
    font-size: 38px;
  }

  .context-privacy {
    margin-top: 22px;
  }

  .form-workspace {
    padding: 42px 24px 64px;
  }
}

@media (max-width: 560px) {
  .application-header {
    align-items: center;
  }

  .application-header .wordmark-sub {
    display: none;
  }

  .form-workspace {
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .invitation-status > div:last-child {
    grid-column: 1 / -1;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-left: 0;
  }

  .form-topline h2,
  .success-panel h2 {
    font-size: 27px;
  }

  .stepper {
    margin: 28px 0 38px;
  }

  .stepper li {
    grid-template-columns: 1fr;
  }

  .stepper li > span {
    width: 26px;
    height: 26px;
  }

  .stepper small {
    display: none;
  }

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

  .field-wide,
  .phone-code,
  .phone-number {
    grid-column: 1;
  }

  .review-group {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .form-actions {
    grid-template-columns: auto 1fr;
  }

  .form-actions [data-next],
  .form-actions [data-submit] {
    grid-column: 2;
  }

  .text-cancel {
    display: none;
  }

  .reference-block {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }
}
