.alliance-membership {
  color: var(--color-text, #171717);
  container-type: inline-size;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.am-form {
  display: grid;
  gap: clamp(22px, 3vw, 32px);
}

.am-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.am-form__intro {
  max-width: 760px;
}

.am-form__intro h2 {
  margin: 0 0 8px;
}

.am-help {
  margin: 0;
  color: #555;
  font-size: 0.9rem;
  line-height: 1.45;
  font-weight: 500;
}

.am-help--payment {
  padding-top: 2px;
}

.am-help p {
  margin: 0 0 0.55em;
}

.am-help p:last-child {
  margin-bottom: 0;
}

.am-form fieldset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin: 0;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid rgba(20, 20, 20, 0.16);
  border-radius: 8px;
  background: #fff;
}

.am-form legend {
  padding: 0 8px;
  font-weight: 800;
  line-height: 1.25;
}

.am-form label,
.am-field {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.am-form input[type="text"],
.am-form input[type="email"],
.am-form input[type="tel"],
.am-form input[type="date"],
.am-form input[type="file"],
.am-form textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(20, 20, 20, 0.22);
  border-radius: 6px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  background: #fff;
  color: #171717;
}

.am-form input[type="file"] {
  padding-top: 9px;
  padding-bottom: 9px;
}

.am-form input:focus-visible,
.am-form textarea:focus-visible,
.am-form button:focus-visible,
.am-signature__pad:focus-visible {
  outline: 3px solid var(--blue-500, #4a5fbf);
  outline-offset: 2px;
}

.am-form [aria-invalid="true"] {
  border-color: #b3261e;
}

.am-form textarea {
  min-height: 96px;
  resize: vertical;
}

.am-form__full,
.am-checkbox,
.am-radio,
.am-signature {
  grid-column: 1 / -1;
}

.am-form label:not(.am-date-part):has(input[required]) > span:first-child::after,
.am-form label:has(textarea[required]) > span:first-child::after {
  content: " *";
  color: #b3261e;
}

.am-field--required > .am-field__label::after {
  content: " *";
  color: #b3261e;
}

.am-required-marker {
  color: #b3261e;
}

.am-checkbox:has(input[required]) > span::after {
  content: " *";
  color: #b3261e;
}

.am-checkbox,
.am-radio {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-weight: 500;
  min-height: 44px;
}

.am-checkbox input,
.am-radio input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
}

.am-checkbox .am-field-error {
  grid-column: 2;
}

.am-date-field {
  grid-column: 1 / -1;
  max-width: 520px;
}

.am-date-parts {
  display: grid;
  grid-template-columns: minmax(72px, 0.85fr) minmax(72px, 0.85fr) minmax(96px, 1.3fr);
  gap: 10px;
}

.am-date-part {
  min-width: 0;
}

.am-date-part span {
  font-size: 0.875rem;
  line-height: 1.3;
}

.am-field-error {
  color: #b3261e;
  font-size: 0.92rem;
  line-height: 1.4;
  font-weight: 700;
}

.am-form fieldset > .am-field-error {
  grid-column: 1 / -1;
}

.am-requirement-note {
  margin: 0;
  color: #4c4c4c;
  font-size: 0.9rem;
  line-height: 1.4;
  font-weight: 600;
}

.am-requirement-note:empty {
  display: none;
}

.am-signature {
  display: grid;
  gap: 10px;
}

.am-payment-details {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.am-payment-details[hidden] {
  display: none;
}

.am-signature__pad-wrap {
  border: 1px solid rgba(20, 20, 20, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, transparent 0, transparent 35px, rgba(0, 0, 0, 0.06) 36px) border-box;
  min-height: clamp(180px, 34vw, 240px);
}

.am-signature__pad {
  display: block;
  width: 100%;
  height: clamp(180px, 34vw, 240px);
  touch-action: none;
  cursor: crosshair;
}

.am-signature__actions {
  display: flex;
  justify-content: flex-start;
}

.am-form__submit {
  display: flex;
  justify-content: flex-start;
}

.am-form .btn {
  height: auto;
  min-height: 52px;
  padding-top: 12px;
  padding-bottom: 12px;
  white-space: normal;
  text-align: center;
}

.am-notice {
  margin: 0 0 24px;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
}

.am-notice h3 {
  margin: 0 0 6px;
}

.am-notice p,
.am-notice ul {
  margin: 0;
}

.am-notice--success {
  border-color: #2e7d32;
  background: #f3fbf4;
}

.am-notice--error {
  border-color: #b3261e;
  background: #fff6f4;
}

@media (max-width: 720px) {
  .am-form fieldset {
    padding: 16px;
  }

  .am-payment-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .am-date-parts {
    grid-template-columns: minmax(64px, 0.8fr) minmax(64px, 0.8fr) minmax(92px, 1.4fr);
    gap: 8px;
  }

  .am-form__submit .btn,
  .am-signature__actions .btn {
    width: 100%;
  }
}

@media (max-width: 360px) {
  .am-date-parts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .am-date-part:last-child {
    grid-column: 1 / -1;
  }
}

/* Success-screen payment block (two-step join): quiet panel below the
   confirmation, same flat register as the form. */
.am-success-payment {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1.5px solid rgba(26, 22, 20, 0.25);
}
.am-success-payment h4 {
  margin: 0 0 8px;
  font-size: 1.125rem;
}
