/* 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;
}

/* Action group — multiple CTAs after submit (Ana Sayfa + context link + reset) */
.tdp-form-success-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.tdp-form-success-actions .tdp-form-success-btn,
.tdp-form-success-actions .tdp-form-success-btn-secondary {
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  font-family: inherit;
  line-height: 1;
}
.tdp-form-success-actions .tdp-form-success-btn {
  background: #c41e3a;
  color: #fff;
}
.tdp-form-success-actions .tdp-form-success-btn:hover,
.tdp-form-success-actions .tdp-form-success-btn:focus-visible {
  background: #a01930;
  color: #fff;
}
.tdp-form-success-actions .tdp-form-success-btn-secondary {
  background: #fff;
  color: #c41e3a;
  border-color: #c41e3a;
}
.tdp-form-success-actions .tdp-form-success-btn-secondary:hover,
.tdp-form-success-actions .tdp-form-success-btn-secondary:focus-visible {
  background: #c41e3a;
  color: #fff;
}
@media (max-width: 480px) {
  .tdp-form-success-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .tdp-form-success-actions .tdp-form-success-btn,
  .tdp-form-success-actions .tdp-form-success-btn-secondary {
    width: 100%;
  }
}
.tdp-form-success h3:focus,
.tdp-form-success h3:focus-visible {
  outline: 2px solid #c41e3a;
  outline-offset: 4px;
  border-radius: 4px;
}

/* --- 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;
}
/* Custom country trigger button (replaces native <select>) */
.tdp-phone-wrap .tdp-phone-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 12px;
  height: 46px;
  border: none;
  border-right: 1px solid #eef0f3;
  background: #fafbfc;
  border-radius: 6px 0 0 6px;
  cursor: pointer;
  font-family: inherit;
  color: #0a0a0f;
  transition: background 0.15s ease;
}
.tdp-phone-wrap .tdp-phone-trigger:hover:not(:disabled) {
  background: #f3f4f6;
}
.tdp-phone-wrap .tdp-phone-trigger:focus-visible {
  outline: 2px solid #c41e3a;
  outline-offset: -2px;
}
.tdp-phone-wrap .tdp-phone-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
/* Bayrak ikonu — DEFENSIVE: hem parent-ön-ekli hem standalone form, hem
   direct child hem descendant img/svg dahil. Içerideki <img>'in inline
   `width:100%` style'i container width'i sıfır olursa SVG intrinsic
   boyutuna büyürdü; max-width/height ile bunu da sıkıca sınırlıyoruz. */
.tdp-phone-trigger-flag,
.tdp-phone-wrap .tdp-phone-trigger-flag {
  width: 24px !important;
  height: 16px !important;
  max-width: 24px;
  max-height: 16px;
  min-width: 24px;
  min-height: 16px;
  display: inline-block;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  background: #fff;
  vertical-align: middle;
  line-height: 0;
}
.tdp-phone-trigger-flag img,
.tdp-phone-trigger-flag svg,
.tdp-phone-wrap .tdp-phone-trigger-flag img,
.tdp-phone-wrap .tdp-phone-trigger-flag svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}
.tdp-phone-wrap .tdp-phone-trigger-chev {
  color: #6b7280;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.tdp-phone-wrap .tdp-phone-trigger[data-state='open'] .tdp-phone-trigger-chev {
  transform: rotate(180deg);
}
/* Phone number text input */
.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;
}

/* Custom popover dropdown */
.tdp-phone-dropdown {
  width: 320px;
  max-width: calc(100vw - 24px);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow:
    0 10px 38px -10px rgba(15, 23, 42, 0.18),
    0 10px 20px -15px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  font-family: inherit;
  color: #0a0a0f;
  z-index: 100;
  animation: tdp-phone-fade-in 0.14s ease;
}
@keyframes tdp-phone-fade-in {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}
.tdp-phone-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f3f5;
  color: #6b7280;
}
.tdp-phone-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: #0a0a0f;
}
.tdp-phone-search input::placeholder {
  color: #9ca3af;
}
.tdp-phone-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.tdp-phone-list::-webkit-scrollbar {
  width: 8px;
}
.tdp-phone-list::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 4px;
}
.tdp-phone-list::-webkit-scrollbar-thumb:hover {
  background: #d1d5db;
}
.tdp-phone-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 6px 12px;
  list-style: none;
}
.tdp-phone-empty {
  padding: 16px 14px;
  text-align: center;
  color: #9ca3af;
  font-size: 13.5px;
  list-style: none;
}
.tdp-phone-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.3;
  list-style: none;
  user-select: none;
}
.tdp-phone-item.is-active {
  background: rgba(196, 30, 58, 0.08);
}
.tdp-phone-item.is-selected {
  background: rgba(196, 30, 58, 0.12);
  font-weight: 500;
}
.tdp-phone-item-flag {
  width: 24px !important;
  height: 16px !important;
  max-width: 24px;
  max-height: 16px;
  min-width: 24px;
  min-height: 16px;
  flex-shrink: 0;
  display: inline-block;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
  background: #fff;
  vertical-align: middle;
  line-height: 0;
}
.tdp-phone-item-flag img,
.tdp-phone-item-flag svg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}
.tdp-phone-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0a0a0f;
}
.tdp-phone-item-code {
  flex-shrink: 0;
  color: #6b7280;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.tdp-phone-item-check {
  flex-shrink: 0;
  color: #c41e3a;
}
.tdp-phone-globe {
  color: #6b7280;
}

/* Responsive: narrow viewport */
@media (max-width: 480px) {
  .tdp-phone-dropdown {
    width: calc(100vw - 24px);
  }
}

/* --- 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);
}
