/* Auth modal */
.auth-overlay,
.profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2000;
  display: none;
}
.auth-modal,
.profile-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 2010;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.auth-modal > div,
.profile-modal > div {
  background: #fff;
  border-radius: 10px;
  max-width: 460px;
  width: 100%;
  max-height: 96vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.profile-modal > div {
  max-width: 600px;
}
.auth-modal .auth-header {
  background: #1F1F1F;
  color: #fff;
  border-radius: 10px 10px 0 0;
  padding: 8px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.auth-modal .auth-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-modal .auth-tab {
  background: transparent;
  border: none;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.3s ease;
}
.auth-modal .auth-tab.active {
  color: #fff;
  font-weight: bold;
}
.auth-modal .auth-tab:hover {
  color: #fff;
}
.auth-modal .auth-body {
  background: #fff;
  padding: 14px;
  border-radius: 0 0 10px 10px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 320px;
}
.auth-form.hidden {
  display: none;
}
.auth-form label {
  font-weight: 500;
  margin-top: 1px;
  margin-bottom: 1px;
  color: rgba(59, 59, 59, 1);
  font-size: 0.95rem;
}
.auth-form .required {
  color: #1F1F1F;
}
.auth-form input,
.auth-form input[type="file"] {
  height: 38px;
  padding: 0 10px;
  border: 2px solid rgba(59, 59, 59, 0.3);
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}
.auth-form input:focus {
  outline: none;
  border-color: #1F1F1F;
}

.auth-form input.field-invalid {
  border-color: #c33;
}

.auth-form .field-error {
  margin-top: -8px;
  color: #c33;
  font-size: 0.84rem;
  line-height: 1.3;
}

.auth-form .password-input-wrap + .field-error {
  margin-top: -8px;
}

.auth-form input[type="file"] {
  padding: 6px 10px;
  cursor: pointer;
}

.auth-form .agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.3;
}

.auth-form .agreement-check input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  padding: 0;
}

.auth-form .agreement-check a {
  color: #900000;
  text-decoration: underline;
}

.auth-form small.password-hint {
  font-size: 0.85rem;
  color: rgba(59, 59, 59, 0.7);
  margin-top: -8px;
  margin-bottom: 4px;
}

.auth-form .auth-submit.secondary {
  background: #fff;
  color: #1f1f1f;
  border: 2px solid rgba(59, 59, 59, 0.25);
}

.auth-form .auth-submit.secondary:hover {
  background: rgba(59, 59, 59, 0.08);
}

.auth-form .auth-submit.google-auth {
  background: #fff;
  color: #1f1f1f;
  border: 2px solid rgba(59, 59, 59, 0.25);
}

.auth-form .auth-submit.google-auth:hover {
  background: rgba(59, 59, 59, 0.08);
}

/* Кнопка "Показать/Скрыть" для полей пароля */
.auth-form .password-input-wrap {
  position: relative;
}

.auth-form .password-input-wrap input[type="password"],
.auth-form .password-input-wrap input[type="text"] {
  width: 100%;
  /* Оставляем место справа под кнопку */
  padding-right: 120px;
}

.auth-form .password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  width: 44px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(59, 59, 59, 0.3);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  color: #1f1f1f;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.auth-form .password-toggle:hover {
  background: rgba(59, 59, 59, 0.08);
}
.auth-message {
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  display: none;
}
.auth-message.error {
  background: #fee;
  color: #c33;
  border: 1px solid #fcc;
}
.auth-message.success {
  background: #efe;
  color: #3c3;
  border: 1px solid #cfc;
}
.address-suggestions {
  list-style: none;
  padding: 0;
  margin: 2px 0 0 0;
  background: #fff;
  border: 1px solid rgba(59, 59, 59, 0.3);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 10000 !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.address-suggestions li {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(59, 59, 59, 0.1);
  transition: background 0.2s ease;
}
.address-suggestions li:hover {
  background: rgba(205, 0, 0, 0.1);
}
.address-suggestions li:last-child {
  border-bottom: none;
}
.auth-form .avatar-section {
  text-align: center;
  margin-bottom: 16px;
}
.auth-form .avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 10px;
  border: 2px solid #1F1F1F;
}
.auth-submit {
  height: 44px;
  border: none;
  background: #1F1F1F;
  color: #fff;
  border-radius: 10px;
  margin-top: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  font-weight: 500;
}
.auth-submit:hover {
  background: #900000;
}
.auth-submit.logout-btn {
  background: rgba(59, 59, 59, 1);
  margin-top: 12px;
}
.auth-submit.logout-btn:hover {
  background: rgba(40, 40, 40, 1);
}
.forgot {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.9rem;
  color: #1F1F1F;
  text-decoration: none;
}
.forgot:hover {
  text-decoration: underline;
}
.profile-modal .profile-header {
  background: #1F1F1F;
  color: #fff;
  padding: 16px 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.profile-modal .profile-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-family: "Prosto One", sans-serif;
  font-weight: normal;
}
.profile-modal .profile-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.profile-modal .profile-close:hover {
  transform: scale(1.1);
}
.profile-modal .profile-body {
  padding: 20px;
}

@media (max-width: 640px) {
  .auth-modal > div,
  .profile-modal > div {
    max-width: 95vw;
    margin: 0 auto;
  }
  .auth-form {
    min-width: auto;
  }
}
