.auth-sms-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.auth-sms-modal[hidden] {
  display: none !important;
}

.auth-sms-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}

.auth-sms-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
  padding: 28px 24px 24px;
  max-height: min(92vh, 640px);
  overflow-y: auto;
}

.auth-sms-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-sms-modal__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.auth-sms-modal__logo-wrap {
  text-align: center;
  margin-bottom: 20px;
}

.auth-sms-modal__logo {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.auth-sms-modal__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
}

.auth-sms-modal__lead {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
}

.auth-sms-modal__sent strong {
  color: #0f172a;
  font-weight: 700;
}

.auth-sms-modal__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.auth-sms-modal__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.auth-sms-phone {
  display: flex;
  align-items: stretch;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-sms-phone:focus-within {
  border-color: var(--p24-primary, #00ba77);
  box-shadow: 0 0 0 3px var(--p24-primary-ring, rgba(0, 186, 119, 0.2));
}

.auth-sms-phone__prefix {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  background: #f1f5f9;
  border-right: 1px solid #e2e8f0;
  user-select: none;
}

.auth-sms-phone__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: none;
  padding: 0 14px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  background: transparent;
  outline: none;
}

.auth-sms-phone__input::placeholder {
  color: #94a3b8;
}

.auth-sms-modal__code-input {
  width: 100%;
  height: 52px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.55em;
  padding-left: 0.55em;
  margin-bottom: 12px;
}

.auth-sms-modal__code-input:focus {
  outline: none;
  border-color: var(--p24-primary, #00ba77);
  box-shadow: 0 0 0 3px var(--p24-primary-ring, rgba(0, 186, 119, 0.2));
}

.auth-sms-modal__code-input::placeholder {
  letter-spacing: 0.55em;
  color: #94a3b8;
  font-weight: 600;
  opacity: 1;
}

.auth-sms-modal__submit {
  width: 100%;
  margin-top: 16px;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
}

.auth-sms-modal__alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.auth-sms-modal__alert[hidden] {
  display: none !important;
}

.auth-sms-modal__resend {
  margin-top: 14px;
  text-align: center;
}

.auth-sms-modal__timer {
  margin: 0 0 8px;
  font-size: 13px;
  color: #64748b;
}

.auth-sms-modal__resend-btn {
  width: 100%;
}

.auth-sms-modal__resend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-sms-modal__back {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 0;
  border: none;
  background: none;
  color: var(--p24-primary, #00ba77);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.auth-sms-modal__back:hover {
  text-decoration: underline;
}

body.auth-sms-modal-open {
  overflow: hidden;
}

.auth-page--modal-only {
  min-height: 40vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-page--modal-only .auth-page__hint {
  font-size: 14px;
  color: var(--p24-muted);
}

.auth-page--modal-only .auth-page__hint a {
  color: var(--p24-primary);
  font-weight: 600;
}
