.member-form-panel {
  max-width: 920px;
  margin: 28px auto 0;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: rgba(250, 248, 242, 0.96);
  color: var(--texto);
  box-shadow: 0 18px 42px rgba(15, 31, 22, 0.2);
  text-align: left;
  animation: memberFormFadeIn 0.36s ease both;
  transform-origin: top center;
}

.member-form-panel.is-hidden {
  display: none;
}

.member-form-panel.is-closing {
  animation: memberFormFadeOut 0.32s ease both;
}

.member-form {
  display: grid;
  gap: 18px;
}

.member-form-section {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(31, 61, 43, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.member-form-section legend,
.member-form-intro h3 {
  margin: 0;
  color: var(--verde-bosque);
  font-size: 1.2rem;
  font-weight: 900;
}

.member-form-intro p {
  color: var(--texto-suave) !important;
}

.member-form-row.two-columns,
.member-form-row.three-columns {
  display: grid;
  gap: 14px;
}

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

.member-form-row.three-columns {
  grid-template-columns: minmax(0, 1fr) 0.55fr minmax(0, 1fr);
}

.member-form label:not(.member-checkbox) {
  display: block;
  color: var(--texto);
  font-weight: 800;
}

.member-radio-group,
.member-checkbox-group {
  display: grid;
  gap: 8px;
  color: var(--texto);
  font-weight: 800;
}

.member-help {
  display: block;
  margin: 4px 0 0;
  color: var(--texto-suave) !important;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
}

.required-mark {
  display: inline;
  margin-left: 2px;
  color: #9b2c2c;
  font-weight: 900;
  line-height: 1;
  vertical-align: baseline;
}

.member-form input,
.member-form textarea,
.member-form select {
  width: 100%;
  border: 1px solid rgba(31, 61, 43, 0.18);
  border-radius: 16px;
  padding: 14px 15px;
  font: inherit;
  background: var(--blanco);
  color: var(--texto);
}

.member-form label:not(.member-checkbox) > input,
.member-form label:not(.member-checkbox) > textarea,
.member-form label:not(.member-checkbox) > select {
  display: block;
  margin-top: 8px;
}

.member-form textarea {
  resize: vertical;
}

.member-form input:focus,
.member-form textarea:focus,
.member-form select:focus {
  outline: 3px solid rgba(79, 125, 74, 0.2);
  border-color: var(--verde-hoja);
}

.member-radio-group,
.member-checkbox-group {
  padding: 14px;
  border: 1px solid rgba(31, 61, 43, 0.12);
  border-radius: 18px;
  background: rgba(250, 248, 242, 0.74);
}

.member-radio-group label,
.member-checkbox {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  color: var(--texto);
  font-weight: 700;
}

.member-radio-group input,
.member-checkbox input {
  width: auto;
  margin-top: 4px;
  accent-color: var(--verde-bosque);
}

.member-radio-group:has(#member-minor-label),
.member-radio-group:has(#member-experience-label) {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  column-gap: 18px;
  row-gap: 10px;
}

.member-radio-group:has(#member-minor-label) > span,
.member-radio-group:has(#member-experience-label) > span {
  grid-column: 1 / -1;
}

.member-radio-group:has(#member-minor-label) label,
.member-radio-group:has(#member-experience-label) label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  line-height: 1;
}

.member-radio-group:has(#member-minor-label) input,
.member-radio-group:has(#member-experience-label) input {
  margin: 0;
}

.member-checkbox-group:has(input[name="member-areas"]) {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
}

.member-checkbox-group:has(input[name="member-areas"]) > span {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  color: var(--texto);
  font-weight: 900;
}

.member-checkbox-group:has(input[name="member-areas"]) .member-checkbox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 12px 14px;
  border: 1px solid rgba(31, 61, 43, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.member-checkbox-group:has(input[name="member-areas"]) .member-checkbox span {
  grid-column: 1;
  grid-row: 1;
  text-align: left;
}

.member-checkbox-group:has(input[name="member-areas"]) .member-checkbox input {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  width: auto;
  margin: 0;
}

.declaration-box {
  padding: 14px;
  border: 1px solid rgba(31, 61, 43, 0.14);
  border-radius: 18px;
  background: rgba(79, 125, 74, 0.08);
}

#member-minor-section > .member-help {
  color: #1f2d24 !important;
}

.declaration-box:has(#member-adult-declaration) {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.declaration-box:has(#member-adult-declaration) span {
  display: block;
  width: min(720px, 100%);
  text-align: center;
  line-height: 1.45;
}

.declaration-box:has(#member-adult-declaration) input {
  align-self: center;
  margin: 0;
}

.declaration-box:has(#member-final-declaration) {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.declaration-box:has(#member-final-declaration) span {
  display: block;
  width: min(720px, 100%);
  text-align: center;
  line-height: 1.45;
}

.declaration-box:has(#member-final-declaration) .required-mark {
  display: inline;
  margin-left: 3px;
  vertical-align: baseline;
}

.declaration-box:has(#member-final-declaration) input {
  align-self: center;
  margin: 0;
}

.member-conditional-section.is-hidden {
  display: none;
}

.member-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.member-submit-button,
.member-cancel-button {
  border-radius: 999px;
  padding: 14px 24px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.member-submit-button {
  border: 0;
  background: linear-gradient(135deg, var(--verde-bosque), var(--verde-hoja));
  color: var(--blanco);
}

.member-submit-button:hover {
  background: linear-gradient(135deg, var(--verde-profundo), var(--verde-bosque));
  transform: translateY(-2px);
}

.member-submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.member-cancel-button {
  border: 1px solid var(--verde-bosque);
  background: var(--blanco);
  color: var(--verde-bosque);
}

.member-status {
  min-height: 22px;
  margin: 0 !important;
  color: var(--texto-suave) !important;
  font-weight: 800;
  text-align: center;
}

.member-status.success {
  color: var(--verde-bosque) !important;
}

.member-status.error {
  color: #9b2c2c !important;
}

.member-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

@keyframes memberFormFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes memberFormFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  .member-form-panel,
  .member-form-panel.is-closing {
    animation: none;
  }
}

@media (max-width: 860px) {
  .member-form-row.two-columns,
  .member-form-row.three-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .member-form-panel {
    padding: 18px;
  }

  .member-form-section {
    padding: 18px;
  }

  .member-form-actions {
    flex-direction: column-reverse;
  }

  .member-submit-button,
  .member-cancel-button {
    width: 100%;
  }
}