#tp-login-overlay,
#tp-signup-overlay,
.tp-modal-overlay {
  display: none;
  position: fixed !important;
  inset: 0;
  min-height: 100vh;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  z-index: 999999 !important;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 16px 20px;
  overflow-y: auto;
  box-sizing: border-box;
}

#tp-login-overlay.open,
#tp-signup-overlay.open,
.tp-modal-overlay.open {
  display: flex !important;
}

#tp-login-modal,
#tp-signup-modal,
.tp-modal-dialog {
  background: #fff;
  border-radius: 24px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  position: relative;
  padding: 32px;
  box-sizing: border-box;
}

.tp-modal-dialog .tp-modal-close,
#tp-login-modal .tp-modal-close,
#tp-signup-modal .tp-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 2;
}

.tp-modal-dialog .tp-modal-close svg,
#tp-login-modal .tp-modal-close svg,
#tp-signup-modal .tp-modal-close svg {
  width: 18px;
  height: 18px;
  stroke: #222;
}

.tp-modal-dialog h2,
#tp-login-modal h2,
#tp-signup-modal h2 {
  margin: 0 0 12px;
  font-size: 1.85rem;
  line-height: 1.1;
  color: #111;
}

.tp-modal-dialog p,
#tp-login-modal p,
#tp-signup-modal p {
  margin: 0 0 24px;
  color: #4d4d4d;
  font-size: 0.95rem;
  line-height: 1.6;
}

.tp-modal-footer {
  margin-top: 28px;
  margin-bottom: 22px;
  color: #555;
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
}

#tp-login-modal::-webkit-scrollbar {
  width: 6px;
}

#tp-login-modal::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 999px;
}

.tp-login-header {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.tp-login-logo {
  max-width: 180px;
  width: 100%;
  height: auto;
}

.tp-input-group {
  margin-bottom: 16px;
}

.tp-input-group label {
  display: none;
}

.tp-input-group.tp-input-group-label label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #444;
  font-weight: 700;
}

.tp-input-group input,
.tp-input-group select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #111;
  background: #f8fafc;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.tp-input-group input::placeholder,
.tp-input-group select {
  color: #8f8f8f;
}

.tp-input-group input:focus,
.tp-input-group select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

.tp-input-group input.tp-input-error,
.tp-input-group select.tp-input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.tp-validation-message {
  color: #d32f2f;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 8px;
  min-height: 20px;
}

.tp-show-password {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #333;
  font-size: 0.95rem;
}

.tp-show-password input {
  accent-color: #2466d8;
}

.tp-radio-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-bottom: 20px;
}

.tp-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: #222;
  cursor: pointer;
}

.tp-radio-row input[type="radio"] {
  accent-color: #2466d8;
  width: 18px;
  height: 18px;
  margin: 0;
}

.tp-modal-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

.tp-modal-actions .btn {
  justify-content: center;
  padding: 14px 24px;
  font-size: 1rem;
}

.tp-forgot-link {
  margin-left: auto;
  color: #2466d8;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.tp-forgot-link:hover {
  text-decoration: underline;
}

.tp-modal-footer {
  margin-top: 22px;
  color: #555;
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 8px;
}

.tp-modal-footer a {
  color: #2466d8;
  text-decoration: none;
}

.tp-modal-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  #tp-login-modal,
  #tp-signup-modal,
  #tp-forgot-modal,
  .tp-modal-dialog {
    padding: 24px 20px;
  }

  .tp-modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .tp-modal-actions .btn {
    width: 100%;
  }

  .tp-forgot-link {
    margin: 12px auto 0;
    text-align: center;
    width: 100%;
    display: inline-block;
  }

  .tp-radio-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px 8px;
  }

  .tp-modal-footer {
    justify-content: center;
    text-align: center;
  }
}

#tp-signup-modal {
  position: relative;
}

.select2-container {
  width: 100% !important;
}

.select2-container--open .select2-dropdown {
  z-index: 1000001 !important;
  position: absolute !important;
}

.select2-container--open .select2-search__field {
  width: 100% !important;
}

.select2-container .select2-selection--single {
  height: auto !important;
  padding: 14px 16px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  font-size: 0.95rem !important;
  color: #111 !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease !important;
}

.select2-container--open .select2-selection--single {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1) !important;
  background: #ffffff !important;
}

.select2-container .select2-selection--single .select2-selection__rendered {
  padding-left: 0 !important;
  padding-right: 0 !important;
  line-height: 1.4 !important;
  color: #111 !important;
}

.select2-container .select2-selection--single .select2-selection__arrow {
  height: 100% !important;
  right: 12px !important;
}