/* ==============================
   MODAL — Application Form
   ============================== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 460px;
  border-radius: 24px;
  background: #0e0e0e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(160, 32, 32, 0.08);
  position: relative;
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

/* Top gradient line */
.modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #a02020, transparent);
}

/* Glow */
.modal::after {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 200px;
  background: radial-gradient(circle, rgba(160, 32, 32, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--gray-30);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
}

.modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.modal__body {
  padding: 40px 36px 36px;
  position: relative;
  z-index: 1;
}

.modal__badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 8px;
  background: rgba(160, 32, 32, 0.12);
  border: 1px solid rgba(160, 32, 32, 0.25);
  color: #e04040;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.modal__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.modal__desc {
  font-size: 0.88rem;
  color: var(--gray-40);
  line-height: 1.5;
  margin-bottom: 28px;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal__input {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-size: 0.92rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.25s ease;
}

.modal__input::placeholder {
  color: var(--gray-20);
}

.modal__input:focus {
  border-color: rgba(160, 32, 32, 0.4);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(160, 32, 32, 0.08);
}

.modal__textarea {
  resize: none;
  min-height: 90px;
}

.modal__submit {
  padding: 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #a02020, #8a1a1a);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(160, 32, 32, 0.3);
  margin-top: 4px;
}

.modal__submit:hover {
  background: linear-gradient(135deg, #b82525, #a02020);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(160, 32, 32, 0.4);
}

.modal__submit span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.modal__submit:hover span {
  transform: translateX(3px);
}

.modal__privacy {
  text-align: center;
  font-size: 0.72rem;
  color: var(--gray-20);
  margin-top: 4px;
  line-height: 1.4;
}

/* Success state */
.modal__success {
  text-align: center;
  padding: 30px 0 10px;
  animation: successFadeIn 0.5s ease;
}

@keyframes successFadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal__success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
  border: 2px solid rgba(34, 197, 94, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
  animation: iconPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes iconPop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.modal__success-icon svg {
  width: 36px;
  height: 36px;
}

.modal__success-icon::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid rgba(34, 197, 94, 0.1);
  animation: ringExpand 1s ease forwards;
}

@keyframes ringExpand {
  from { transform: scale(0.8); opacity: 1; }
  to { transform: scale(1.4); opacity: 0; }
}

.modal__success h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.modal__success p {
  font-size: 0.92rem;
  color: var(--gray-40);
  line-height: 1.6;
}

.modal__success-badge {
  display: inline-block;
  margin-top: 20px;
  padding: 8px 20px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Validation */
.modal__input.error {
  border-color: rgba(224, 64, 64, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(224, 64, 64, 0.1) !important;
  animation: inputShake 0.4s ease;
}

@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.modal__error-text {
  font-size: 0.72rem;
  color: #e04040;
  margin-top: -8px;
  padding-left: 4px;
}

/* Universal success overlay for all forms */
.form-success-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successFadeIn 0.4s ease;
}

.form-success-card {
  text-align: center;
  padding: 48px 44px;
  border-radius: 24px;
  background: #0e0e0e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  max-width: 420px;
  position: relative;
  overflow: hidden;
}

.form-success-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #22c55e, transparent);
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 480px) {
  .modal-overlay {
    padding: 12px;
  }

  .modal__body {
    padding: 32px 20px 28px;
  }

  .modal__title {
    font-size: 1.3rem;
  }

  .form-success-card {
    padding: 36px 24px;
  }
}

