:root {
  --form-radius: 1.5rem;
  --form-border: rgba(132, 34, 138, 0.15);
  --form-shadow: 0 25px 50px -25px rgba(0, 0, 0, 0.35);
  --form-muted: #7a7073;
  --form-bg: #ffffff;
}

.form-page {
  padding-bottom: 4rem;
}

.form-layout {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.form-layout__sidebar,
.form-layout__main {
  width: 100%;
}

.form-layout__main {
  flex: 1;
}

.form-shell {
  background: var(--form-bg);
  border: 1px solid var(--form-border);
  border-radius: var(--form-radius);
  box-shadow: var(--form-shadow);
  padding: clamp(1.5rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
}

.form-shell__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.form-shell__title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--primary, #84228a);
  margin: 0;
}

.form-shell__lead {
  color: var(--form-muted);
  max-width: 640px;
  margin: 0;
}

.form-shell__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--form-muted);
}

.form-status {
  border-radius: 0.8rem;
  padding: 1rem 1.5rem;
  background: rgba(244, 163, 0, 0.08);
  border: 1px solid rgba(244, 163, 0, 0.4);
  color: #8b5d00;
  margin-bottom: 1.5rem;
}

.form-status[data-status="success"] {
  background: rgba(48, 197, 117, 0.1);
  border-color: rgba(48, 197, 117, 0.4);
  color: #1f8e52;
}

.form-status[data-status="error"] {
  background: rgba(217, 107, 107, 0.12);
  border-color: rgba(217, 107, 107, 0.6);
  color: #9f2b2b;
}

.form-stepper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 0;
}

.form-stepper__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--form-muted);
}

.form-stepper__item[data-active="true"] {
  color: var(--primary, #84228a);
}

.form-stepper__bullet {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(132, 34, 138, 0.2);
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #fff;
}

.form-section {
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
  background: #ffffff;
}

.form-section__header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.form-section__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  background: rgba(132, 34, 138, 0.1);
  color: var(--primary, #84228a);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
}

.form-section__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  margin: 0;
  color: var(--form-muted);
}

.form-section__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.form-section__description {
  margin: 0.25rem 0 0;
  color: var(--form-muted);
  max-width: 640px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-grid--split {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.form-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 2rem 0 0.75rem;
  color: var(--form-muted);
}

.mdf-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mdf-field__label {
  font-weight: 600;
  color: #2c3e50;
}

.mdf-field__required {
  color: var(--secondary, #f4a300);
}

.mdf-field__control {
  position: relative;
}

.mdf-field__icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--form-muted);
}

.mdf-input {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.85rem;
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mdf-input--select {
  padding-right: 2.5rem;
}

.mdf-field[data-field-state="error"] .mdf-input {
  border-color: rgba(217, 107, 107, 0.9);
  box-shadow: 0 0 0 2px rgba(217, 107, 107, 0.15);
}

.mdf-field__hint {
  font-size: 0.85rem;
  color: var(--form-muted);
}

.mdf-field__errors {
  list-style: none;
  margin: 0;
  padding: 0;
  color: #a12828;
  font-size: 0.85rem;
}

.mdf-checkbox {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.85rem;
}

.mdf-checkbox__input {
  margin-top: 0.3rem;
  width: 1.2rem;
  height: 1.2rem;
}

.mdf-checkbox__label {
  font-weight: 600;
  color: #2c3e50;
}

.mdf-checkbox__label small {
  display: block;
  font-weight: 400;
  color: var(--form-muted);
}

.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

.form-actions .btn {
  min-width: 240px;
  padding: 1rem 2.5rem;
  border-radius: 999px;
  font-weight: 700;
}

.form-nav {
  position: sticky;
  top: 120px;
  border: 1px solid var(--form-border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  background: #fff;
  box-shadow: var(--form-shadow);
}

.form-nav__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--form-muted);
  margin-bottom: 1rem;
}

.form-nav__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-nav__link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  text-decoration: none;
  border: 1px solid transparent;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.form-nav__link:hover,
.form-nav__link:focus-visible {
  border-color: rgba(132, 34, 138, 0.3);
  background: rgba(132, 34, 138, 0.05);
}

.form-nav__link.is-active {
  border-color: rgba(132, 34, 138, 0.5);
  background: rgba(132, 34, 138, 0.08);
}

.form-nav__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: rgba(132, 34, 138, 0.12);
  color: var(--primary, #84228a);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.form-nav__content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.form-nav__content strong {
  font-size: 1rem;
}

.form-nav__content small {
  color: var(--form-muted);
  font-size: 0.85rem;
}

.form-nav__chevron {
  margin-left: auto;
  color: var(--form-muted);
}

@media (min-width: 992px) {
  .form-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .form-layout__sidebar {
    flex: 0 0 320px;
    max-width: 360px;
  }

  .form-layout__main {
    flex: 1;
  }
}

@media (max-width: 991px) {
  .form-layout {
    flex-direction: column;
  }

  .form-layout__sidebar,
  .form-layout__main {
    width: 100%;
    max-width: 100%;
  }

  .form-nav {
    position: static;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 768px) {
  .form-shell {
    border-radius: 1rem;
    padding: 1.25rem;
  }

  .form-section__header {
    flex-direction: column;
  }

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

  .form-actions .btn {
    width: 100%;
    min-width: auto;
  }
}
