/* Попап авторизации/регистрации квиза.
   Стилизован под скриншоты формы amarèssence: бежевый фон, табы с чёрным
   подчёркиванием, поля с тонкой рамкой, чёрная широкая кнопка. */

.apq-popup-overlay {
  position: fixed; inset: 0;
  background: rgba(26, 26, 26, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 99999;
}
.apq-popup-overlay.active { opacity: 1; pointer-events: auto; }

.apq-popup-card {
  position: relative;
  background: #faf6ef;
  border-radius: 16px;
  padding: 36px 32px 28px;
  width: 100%; max-width: 480px;
  max-height: calc(100vh - 48px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  transform: scale(0.95); opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-sizing: border-box;
  font-family: 'Jost', 'Inter', system-ui, sans-serif;
  color: #1a1a1a;
}
.apq-popup-overlay.active .apq-popup-card { transform: scale(1); opacity: 1; }
.apq-popup-card *, .apq-popup-card *::before, .apq-popup-card *::after { box-sizing: border-box; }

.apq-popup-close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: none; cursor: pointer;
  font-size: 26px; line-height: 1; color: #8a8a8a;
  padding: 4px;
}
.apq-popup-close:hover { color: #1a1a1a; }

.apq-popup-subtitle { font-size: 13px; color: #6b6568; margin: 0 0 18px; text-align: center; }

/* ── Табы (как на скриншотах: разделены, активная — чёрная с линией снизу) ── */
.apq-tab-switcher { display: flex; margin-bottom: 26px; }
.apq-tab-button {
  flex: 1; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 14px; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 12px 4px;
  color: #9b958f; border-bottom: 2px solid #e2ddd8;
  transition: color 0.15s, border-color 0.15s;
}
.apq-tab-button.is-active { color: #1a1a1a; border-bottom-color: #1a1a1a; font-weight: 500; }

.apq-tab-panel { display: none; }
.apq-tab-panel.is-active { display: block; }

/* ── Поля ── */
.apq-form { display: flex; flex-direction: column; }
.apq-field { position: relative; display: block; margin-bottom: 14px; }
.apq-field input {
  width: 100%; padding: 15px 16px;
  border: 1px solid #d9d4ce; border-radius: 6px;
  background: #ffffff; color: #1a1a1a;
  font-family: inherit; font-size: 15px;
  outline: none; transition: border-color 0.15s;
  -webkit-appearance: none;
}
.apq-field input:focus { border-color: #1a1a1a; }
.apq-field input::placeholder { color: #a9a39d; }
.apq-field-hint { font-size: 12px; color: #8a847e; margin: -8px 0 14px 2px; }

/* Глазок пароля */
.apq-field--password input { padding-right: 48px; }
.apq-password-toggle {
  position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  width: 24px; height: 24px; border: none; cursor: pointer; padding: 0;
  background: transparent;
}
.apq-password-toggle::before {
  content: '';
  display: block; width: 22px; height: 22px;
  background-color: #8a847e;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.apq-password-toggle.is-active::before { background-color: #1a1a1a; }

/* ── Согласия (квадратные чёрные чекбоксы, как на скриншоте) ── */
.apq-consents { margin: 6px 0 18px; display: flex; flex-direction: column; gap: 12px; }
.apq-check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13px; line-height: 1.55; color: #3b3733; }
.apq-check input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px;
  border: 1px solid #c9c4be; border-radius: 4px; background: #ffffff;
  cursor: pointer; position: relative;
}
.apq-check input:checked { background: #1a1a1a; border-color: #1a1a1a; }
.apq-check input:checked::after {
  content: '';
  position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid #ffffff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Кнопка (широкая чёрная, капс) ── */
.apq-btn { font-family: inherit; cursor: pointer; }
.apq-btn--primary {
  background: #1a1a1a; color: #ffffff; border: none;
  padding: 17px 24px; border-radius: 6px;
  font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  transition: opacity 0.15s;
}
.apq-btn--primary:hover { opacity: 0.88; }
.apq-btn--primary:disabled { opacity: 0.5; pointer-events: none; }
.apq-btn--full { width: 100%; }

.apq-link { color: #1a1a1a; text-decoration: underline; background: none; border: none; cursor: pointer; font-family: inherit; font-size: 13px; }
.apq-link--center { display: block; text-align: center; margin: 16px auto 0; }

/* ── Сообщения AJAX ── */
.apq-ajax-response { display: none; font-size: 13px; line-height: 1.5; margin: 0 0 12px; padding: 10px 12px; border-radius: 6px; }
.apq-ajax-response.is-visible { display: block; }
.apq-ajax-response.is-error { background: #fbeaea; color: #a33030; }
.apq-ajax-response.is-success { background: #ebf3ec; color: #2e6b3e; }

@media (max-width: 480px) {
  .apq-popup-card { padding: 30px 20px 24px; }
}
