/************************************************
  МОДАЛЬНЕ ВІКНО (Modal)
************************************************/
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6); /* темний оверлей */
  display: none;               /* приховано за замовчуванням */
  align-items: center;
  justify-content: center;
  z-index: 9999;               /* поверх усього */
}

.modal {
  background: #fff;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

/* Вкладки (кнопки) вгорі модалки */
.modal-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.modal-tab {
  flex: 1;
  background: #f3f3f3;
  border: 2px solid transparent;
  padding: 0.5rem;
  cursor: pointer;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.3s ease;
  border-radius: 5px;
}
.modal-tab:hover {
  background: #ddd;
}
.modal-tab.active {
  border-color: #2EB86C; /* зелений акцент */
}

/* Форма всередині */
.modal-form {
  display: none; /* тільки активна форму бачимо */
  flex-direction: column;
  gap: 1rem;
}
.modal-form.active {
  display: flex;
}
.modal-form h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  text-transform: uppercase;
  color: #0C1F3F; /* синій */
}
.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #333;
}
.modal-form input {
  padding: 0.5rem;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
}

.btn-submit {
  background-color: #2EB86C;
  color: #fff;
  border: none;
  font-weight: 600;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-submit:hover {
  background-color: #249e5e;
}

/* Клас для показу оверлея з модалкою */
.modal-overlay.show {
  display: flex;
}

@media (max-width: 768px) {
  .modal {
    width: 90%;
    padding: 1.5rem;
  }

  .modal-tabs {
    flex-direction: column;
    gap: 0.5rem;
  }

  .modal-form {
    width: 100%;
  }

  .modal-form label {
    font-size: 1rem;
  }

  .btn-submit {
    width: 100%;
    padding: 0.8rem;
  }
}

@media (max-width: 480px) {
  .modal {
    padding: 1rem;
  }

  .modal-tabs button {
    font-size: 0.9rem;
    padding: 0.5rem;
  }

  .modal-form label {
    font-size: 0.9rem;
  }

  .btn-submit {
    padding: 0.6rem;
  }
}
