.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.modal-content {
  background: #fff;
  margin: 5% auto;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  position: relative;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: #888;
}

.auth-toggle {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.auth-toggle button {
  flex: 1;
  padding: 10px 0;
  background: #f0f0f0;
  border: none;
  cursor: pointer;
  font-weight: bold;
  border-radius: 5px 5px 0 0;
  transition: all 0.3s ease;
  margin: 0 3px;
}

.auth-toggle button.active {
  background: #2abd67;
  color: white;
  cursor: default;
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal input {
  padding: 10px 15px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  outline: none;
}

.modal input:focus {
  border-color: #2abd67;
  box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

.modal .button {
  padding: 10px;
  background: #2abd67;
  border: none;
  color: white;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.modal .button:hover {
  background: #2abd67;
}
.close {
  position: absolute;
  top: -8px; /* сәл жоғары көтерілді */
  right: -8px; /* сәл оңға жылжыды */
  font-size: 26px;
  font-weight: bold;
  color: #2c2c2c;
  background-color: white;
  border: 2px solid #ccc;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1001;
}

.close:hover {
  background-color: #2abd67;
  color: white;
  border-color: #2abd67;
  transform: scale(1.5);
}
@media (max-width: 360px) {
  .header{
    max-width: 360px;
  }
}
@media (max-width: 400px) {
  .header{
    max-width: 400px;
  }
}
@media (max-width: 548px) {
  .header{
    max-width: 548px;
  }
}

/* 📱 МОБИЛЬДІ КІРУ ЖӘНЕ ТІРКЕЛУ ТЕРЕЗЕСІ (Правило 9: Android WebView & Mobile) */
#authModal,
#verifyModal {
  z-index: 1000000 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 0 12px 30px 12px !important;
  box-sizing: border-box !important;
}

#authModal .modal-content,
#verifyModal .modal-content {
  margin: 70px auto 30px auto !important;
  max-height: 85%;
  max-height: calc(100% - 100px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 20px !important;
  box-sizing: border-box !important;
}

@media (max-width: 640px) {
  #authModal .modal-content,
  #verifyModal .modal-content {
    margin: 85px auto 30px auto !important; /* Шапкадан төмен түсіру */
    padding: 24px 18px !important;
    width: 95% !important;
    max-width: 390px !important;
    border-radius: 20px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25) !important;
  }
}
