/* =========================================
   REGISTRATION PAGE + LOGIN PAGE
   ========================================= */

.auth-section {
  padding: 34px 0 84px;
}

.auth-container {
  max-width: 760px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(234, 223, 229, 0.9);
  border-radius: 32px;
  box-shadow: var(--shadow-soft);
  padding: 34px;
}

.auth-card-head {
  margin-bottom: 28px;
}

.auth-title {
  margin: 0;
  font-size: 42px;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: #221c21;
}

.auth-subtitle {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.social-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.social-auth-btn {
  min-height: 60px;
  border: 1px solid rgba(219, 39, 119, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: #302730;
  box-shadow: 0 14px 30px rgba(58, 40, 49, 0.05);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}

.social-auth-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(219, 39, 119, 0.26);
  box-shadow: 0 18px 34px rgba(58, 40, 49, 0.08);
}

.social-auth-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-divider {
  position: relative;
  margin: 28px 0;
  text-align: center;
}

.auth-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--line);
}

.auth-divider span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 15px;
  font-weight: 700;
  color: #342d35;
}

.text-input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid #e6d6df;
  border-radius: 18px;
  background: #fff;
  color: #1d1b1f;
  font-size: 16px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.text-input:focus {
  border-color: rgba(219, 39, 119, 0.38);
  box-shadow: 0 0 0 4px rgba(219, 39, 119, 0.08);
}

.text-input-error {
  border-color: #d94b6a;
  box-shadow: 0 0 0 4px rgba(217, 75, 106, 0.08);
}

.field-error {
  margin: 0;
  color: #c63f62;
  font-size: 14px;
  line-height: 1.5;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.checkbox-row input {
  margin-top: 3px;
}

.checkbox-text {
  color: #463c46;
  font-size: 15px;
  line-height: 1.6;
}

.form-message {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 241, 247, 0.92);
  color: #8a5470;
  font-size: 15px;
  line-height: 1.6;
}

.auth-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.auth-submit-btn {
  min-width: 260px;
}

.auth-footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.auth-link {
  color: var(--pink);
  text-decoration: none;
  font-weight: 700;
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 700px) {
  .auth-card {
    padding: 24px 18px;
    border-radius: 24px;
  }

  .auth-title {
    font-size: 34px;
  }

  .social-auth-grid {
    grid-template-columns: 1fr;
  }

  .auth-submit-btn {
    width: 100%;
    min-width: 0;
  }

  .header-actions-group {
    width: 100%;
    flex-wrap: wrap;
  }
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.social-btn {
  height: 88px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 26px;
  color: #fff;
  box-shadow: 0 16px 32px rgba(52, 33, 44, 0.08);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    opacity 0.22s ease;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(52, 33, 44, 0.12);
}

.social-btn.vk {
  background: #1677f2;
}

.social-btn.yandex {
  background: #ff4a1c;
}

.social-btn.ok {
  background: #ff8a00;
}

.social-btn.gosuslugi {
  background: #ffffff;
  border: 1px solid #d7d7d7;
  color: #2f5fa7;
  font-size: 20px;
}

.btn-no-border {
  border: none;
  outline: none;
}

button.btn,
button.social-auth-btn,
button.option-card,
button.toggle-card {
  border: none;
  outline: none;
}

@media (max-width: 900px) {
  .social-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .social-grid {
    grid-template-columns: 1fr 1fr;
  }

  .social-btn {
    height: 74px;
    font-size: 22px;
  }

  .social-btn.gosuslugi {
    font-size: 17px;
  }
}

/* =========================================
   AUTH EXTRA
   Общие дополнительные стили для /register и /login:
   центрирование CTA, тестовый режим, забыли пароль.
   ========================================= */

.auth-actions-centered {
  justify-content: center;
}

.auth-footer-text-centered {
  text-align: center;
}

.auth-footer-text-strong {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 600;
}

.auth-test-mode-row {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}

.auth-test-mode-btn {
  min-height: 54px;
  padding: 0 24px;
  border-radius: 16px;
  border: 1px solid rgba(219, 39, 119, 0.16);
  background: rgba(255, 248, 251, 0.96);
  color: #6d5866;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: none;
}

.auth-forgot-row {
  margin-top: -2px;
  display: flex;
  justify-content: flex-end;
}

.auth-link-muted {
  color: #8b7e88;
  font-size: 14px;
}

@media (max-width: 700px) {
  .auth-test-mode-row {
    width: 100%;
  }

  .auth-test-mode-btn {
    width: 100%;
    justify-content: center;
  }

  .auth-forgot-row {
    justify-content: flex-start;
  }
}

.terms-checkbox {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: #db2777;
  flex: 0 0 auto;
}

.social-btn-disabled {
  opacity: 0.55;
}

.social-btn-disabled:hover {
  transform: none;
  box-shadow: 0 16px 32px rgba(52, 33, 44, 0.08);
}

.terms-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 24, 30, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.terms-modal {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(27, 20, 25, 0.22);
}

.terms-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.terms-modal-title {
  margin: 0;
  font-size: 24px;
  color: #221c21;
}

.terms-modal-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(219, 39, 119, 0.08);
  color: #8b3d65;
  font-size: 24px;
  cursor: pointer;
}

.terms-modal-body {
  color: #4b4149;
  font-size: 15px;
  line-height: 1.7;
}

.terms-modal-body p {
  margin: 0 0 14px;
}

.terms-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}