/* TDP shared form styles — used by ContactForm, MembershipForm,
   VolunteerForm, CommitteeForm. Editorial tone, accent #c41e3a. */

.tdp-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tdp-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.tdp-form-row.tdp-form-row-single {
  grid-template-columns: 1fr;
}
@media (max-width: 640px) {
  .tdp-form-row {
    grid-template-columns: 1fr;
  }
}

.tdp-form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  position: relative;
  min-width: 0;
}

.tdp-form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tdp-form-label .tdp-form-req {
  color: #c41e3a;
  font-size: 13px;
  line-height: 1;
}
.tdp-form-label .tdp-form-optional {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tdp-form-control {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  color: #0a0a0f;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  appearance: none;
  -webkit-appearance: none;
}
.tdp-form-control:hover:not(:disabled):not(:focus) {
  border-color: #c9cdd4;
}
.tdp-form-control:focus {
  border-color: #c41e3a;
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}
.tdp-form-control:disabled {
  background: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
}

textarea.tdp-form-control {
  height: auto;
  min-height: 140px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

/* valid state — subtle green check ring only after first valid input */
.tdp-form-field[data-valid='true'] .tdp-form-control:not(:focus) {
  border-color: rgba(34, 139, 99, 0.35);
}

/* error state */
.tdp-form-field[data-error='true'] .tdp-form-control {
  border-color: #c41e3a;
  background: #fff8f9;
}
.tdp-form-field[data-error='true'] .tdp-form-control:focus {
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.18);
}

.tdp-form-helper,
.tdp-form-error {
  font-size: 12.5px;
  line-height: 1.45;
  min-height: 17px;
}
.tdp-form-helper {
  color: #6b7280;
}
.tdp-form-error {
  color: #c41e3a;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.tdp-form-error::before {
  content: '!';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  background: #c41e3a;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.tdp-form-counter {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-align: right;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.tdp-form-counter.tdp-form-counter-near {
  color: #d97706;
}
.tdp-form-counter.tdp-form-counter-over {
  color: #c41e3a;
}

/* submit button */
.tdp-form-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 6px;
}
.tdp-form-required-hint {
  font-size: 12px;
  color: #6b7280;
}
.tdp-form-required-hint b {
  color: #c41e3a;
}
.tdp-form-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  background: #c41e3a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.tdp-form-submit:hover:not(:disabled) {
  background: #a01930;
  box-shadow: 0 10px 22px -10px rgba(196, 30, 58, 0.55);
  transform: translateY(-1px);
}
.tdp-form-submit:active:not(:disabled) {
  transform: translateY(0);
}
.tdp-form-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.tdp-form-submit .tdp-form-submit-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tdp-spin 0.7s linear infinite;
}
@keyframes tdp-spin {
  to {
    transform: rotate(360deg);
  }
}

/* form-level banner (non-field errors, rate limits, network) */
.tdp-form-banner {
  padding: 14px 16px;
  background: rgba(196, 30, 58, 0.07);
  border: 1px solid rgba(196, 30, 58, 0.28);
  border-radius: 6px;
  color: #7a1023;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.tdp-form-banner::before {
  content: '!';
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c41e3a;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 1px;
}

/* success card — reused across forms */
.tdp-form-success {
  background: #fafaf8;
  padding: clamp(28px, 4vw, 44px) clamp(24px, 3.5vw, 40px);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-align: center;
}
.tdp-form-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(196, 30, 58, 0.08);
  color: #c41e3a;
  font-size: 24px;
  margin-bottom: 20px;
}
.tdp-form-success h3 {
  font-size: 22px;
  font-weight: 800;
  color: #0a0a0f;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.tdp-form-success p {
  font-size: 15px;
  line-height: 1.7;
  color: #4a5568;
  margin: 0 0 22px;
}
.tdp-form-success button {
  padding: 13px 28px;
  background: #c41e3a;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
}
.tdp-form-success button:hover {
  background: #a01930;
}

/* --- Phone input (wraps react-phone-number-input) --- */
.tdp-phone-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.tdp-phone-wrap:hover {
  border-color: #c9cdd4;
}
.tdp-phone-wrap:focus-within {
  border-color: #c41e3a;
  box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.12);
}
.tdp-form-field[data-error='true'] .tdp-phone-wrap {
  border-color: #c41e3a;
  background: #fff8f9;
}
.tdp-phone-wrap .PhoneInputCountry {
  display: flex;
  align-items: center;
  padding: 0 10px 0 12px;
  border-right: 1px solid #eef0f3;
  background: #fafbfc;
  border-radius: 6px 0 0 6px;
  position: relative;
}
.tdp-phone-wrap .PhoneInputCountryIcon {
  width: 22px;
  height: 16px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
.tdp-phone-wrap .PhoneInputCountrySelectArrow {
  margin-left: 7px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #6b7280;
  opacity: 0.8;
}
.tdp-phone-wrap .PhoneInputCountrySelect {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.tdp-phone-wrap .PhoneInputInput {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: #0a0a0f;
}

/* --- Youth section for membership — kept but cleaner --- */
.tdp-youth-card {
  background: linear-gradient(135deg, rgba(196, 30, 58, 0.08) 0%, rgba(196, 30, 58, 0.02) 100%);
  border: 1px solid rgba(196, 30, 58, 0.25);
  border-radius: 10px;
  padding: clamp(18px, 3vw, 24px);
}
