/* ============================
   АДАПТАЦИЯ ПОД COMM‑СТИЛЬ
   ============================ */

.auth-modal {
  max-width: 400px;
}

.auth-modal .comm-content {
  padding: 28px 24px;
}

.auth-step {
  display: none;
}
.auth-step.active {
  display: block;
}

/* Кнопка "Далее" на всю ширину */
.auth-next-btn {
  width: 100%;
  display: block;
}

/* ============================
   INTL‑TEL‑INPUT (жирность 700)
   ============================ */

.iti {
  width: 100%;
}

.iti__selected-flag {
  display: flex;
  align-items: center;
}

.iti__selected-dial-code {
  margin-top: 0;
  display: flex;
  align-items: center;
  color: #111827;
}

.iti--separate-dial-code .comm-input {
  padding-left: 96px !important;
  height: 42px;
  line-height: 42px;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  padding-top: 0;
  padding-bottom: 0;
}

/* Кастомный поиск */
.custom-search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px 10px 0 0;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

/* Выпадающий список */
.iti__dropdown-content {
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.iti__country-list {
  max-height: 240px;
  overflow-y: auto;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.iti__country {
  padding: 8px 12px;
  display: flex;
  align-items: center;
}
.iti__country:hover {
  background: #f5f5f5;
}
.iti__country-name {
  font-size: 14px;
  color: #111827;
}
.iti__dial-code {
  font-size: 14px;
  color: #777;
}

/* ============================
   ВВОД КОДА (6 цифр)
   ============================ */
.auth-code-container {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.auth-code-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  padding: 0;
  border-radius: 12px;
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  line-height: 52px;
}

.auth-code-digit:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: #fff;
}

/* ============================
   ПОДСКАЗКИ / ОШИБКИ
   ============================ */
.auth-hint {
  margin-bottom: 10px;
  font-size: 14px;
  color: #6b7280;
  text-align: left;
  line-height: 1.4;
}

.auth-hint-code {
  font-size: 14px;
  color: #6b7280;
  text-align: left;
  line-height: 1.4;
}

.auth-hint.error,
.auth-hint-code.error {
  color: #ef4444;
}

#authClose {
    margin-left: auto;
}

/* ============================
   ССЫЛКА "ОТПРАВИТЬ КОД ЕЩЁ РАЗ"
   ============================ */
.auth-resend-link {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 14px;
  color: #2563eb;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}
.auth-resend-link:hover:not(.disabled) {
  text-decoration: underline;
  color: #1d4ed8;
}
.auth-resend-link.disabled {
  color: #9ca3af;
  pointer-events: none;
  cursor: default;
}

@media (max-width: 768px) {
  .auth-modal {
    max-width: 100%;
    margin: 0 16px;
    border-radius: 16px;
  }

  .auth-modal .comm-content {
    padding: 20px 16px;
  }

  .auth-code-container {
    gap: 8px;
  }

  .auth-code-digit {
    width: 38px;
    height: 46px;
    font-size: 20px;
    border-radius: 10px;
    line-height: 46px;
  }

  .auth-hint,
  .auth-hint-code {
    font-size: 13px;
  }

  .auth-resend-link {
    font-size: 13px;
  }

  /* intl-tel-input */
  .iti--separate-dial-code .comm-input {
    padding-left: 84px !important;
    height: 40px;
    line-height: 40px;
    font-size: 15px;
  }

  .iti__country-list {
    max-height: 180px;
  }
}

@media (max-width: 480px) {
  .auth-code-digit {
    width: 34px;
    height: 42px;
    font-size: 18px;
    line-height: 42px;
  }

  .iti__country-name,
  .iti__dial-code {
    font-size: 13px;
  }

  .custom-search {
    font-size: 13px;
    padding: 8px 10px;
  }
}