/* Попапы "Войти" / "Регистрация" / "Восстановление доступа" (Fancybox) —
   единый стиль с лендингом курсовой (.svc-*) и бургер-меню (.mm-*). */

#fancybox-overlay {
    background: rgba(10, 20, 35, .55) !important;
}

/* Опция 'padding': 0 при инициализации fancybox не перекрывает базовый
   #fancybox-wrap { padding: 20px } из jquery.fancybox-1.3.4.css — из-за
   этого #fancybox-outer (к которому привязан #fancybox-close) оказывался
   на 40px уже настоящей видимой карточки (.am-modal), и крестик "уезжал"
   от фактического угла попапа. Обнуляем явно. */
#fancybox-wrap {
    padding: 0 !important;
}

#fancybox-content {
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(10, 20, 40, .25) !important;
    background: #fff !important;
}

#fancybox-close {
    top: 14px !important;
    right: 14px !important;
    width: 32px !important;
    height: 32px !important;
    margin-top: 0 !important;
    background: #f4f8fd !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#fancybox-close:before {
    content: "\00d7";
    font-size: 20px;
    line-height: 1;
    color: #172135;
}

.am-modal {
    --am-accent: #3977df;
    --am-accent-dark: #3475dc;
    --am-ink: #172135;
    --am-muted: #6c7a90;
    --am-line: #dbe6f3;
    --am-soft: #f4f8fd;
    --am-error: #c0392b;
    box-sizing: border-box;
    width: 300px;
    padding: 30px 22px 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--am-ink);
    line-height: 1.45;
}
.am-modal *, .am-modal *:before, .am-modal *:after { box-sizing: border-box; }

.am-modal__title {
    margin: 0 0 20px;
    font-family: inherit;
    font-style: normal;
    font-size: 22px;
    font-weight: 750;
    line-height: 1.2;
    padding: 0 26px 0 0;
    color: var(--am-ink);
}

.am-modal__alert {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fdecea;
    color: var(--am-error);
    font-size: 13px;
    line-height: 1.4;
}

.am-field { margin-bottom: 14px; }
.am-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--am-ink);
}
.am-field input,
.am-field select {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font-size: 16px;
    line-height: 1.4;
    border: 1px solid var(--am-line);
    border-radius: 12px;
    background: #fff;
    color: var(--am-ink);
    outline: 0;
    font-family: inherit;
}
.am-field select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236c7a90' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}
.am-field input:focus,
.am-field select:focus {
    border-color: var(--am-accent);
    box-shadow: 0 0 0 3px rgba(57, 120, 223, .12);
}
.am-field--captcha { display: flex; justify-content: center; margin: 4px 0 2px; }

.am-modal__links {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 20px;
    font-size: 13px;
}
.am-modal__links a {
    color: var(--am-accent-dark);
    text-decoration: none;
    font-weight: 650;
}

.am-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    background: var(--am-accent);
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
}
.am-btn:active { transform: translateY(1px); }

@media (min-width: 420px) {
    .am-modal { width: 360px; padding: 34px 30px 28px; }
}

/* Анкета для авторов (#feedbackauthor, 30.09.2026): шире, textarea, пояснения, успех, оранжевая кнопка */
.am-modal__lead { margin: -10px 0 18px !important; padding: 0 !important; font-size: 14px !important; line-height: 1.45 !important; color: var(--am-muted) !important; font-family: inherit !important; }
.am-modal__hint { margin: -4px 0 12px !important; padding: 0 !important; font-size: 12px !important; color: var(--am-muted) !important; font-family: inherit !important; }
.am-req { color: #e2574c; font-weight: 700; }
.am-field textarea {
    width: 100%;
    min-height: 104px;
    padding: 11px 14px;
    font-size: 16px;
    line-height: 1.4;
    border: 1px solid var(--am-line);
    border-radius: 12px;
    background: #fff;
    color: var(--am-ink);
    outline: 0;
    font-family: inherit;
    resize: vertical;
}
.am-field textarea:focus { border-color: var(--am-accent); box-shadow: 0 0 0 3px rgba(57, 120, 223, .12); }
.am-field input::placeholder, .am-field textarea::placeholder { color: #9aa8bc; }
.am-modal__alert.is-ok { background: #e8f6ee; color: #1f7a4d; font-size: 15px; padding: 14px 16px; }
.am-btn--orange { background: linear-gradient(180deg, #ff952b 0%, #ff7b0d 100%); box-shadow: 0 10px 24px rgba(255, 128, 14, .25); }
.am-btn--orange:hover { background: linear-gradient(180deg, #ff8a16 0%, #f07000 100%); }
@media (min-width: 460px) {
    .am-modal--wide { width: 420px; }
}
/* Серые квадратные углы подложки fancybox за скруглённым окном и её «тени» — убрать */
#fancybox-outer { background: transparent !important; box-shadow: none !important; }
.fancybox-bg { display: none !important; }
/* Узкий экран. Fancybox (autoScale) ужимает контент до «ширина экрана − 80 px» — окно анкеты берёт
   ровно эту ширину, чтобы белая карточка и форма совпадали; reCAPTCHA (304 px) уменьшается ступенями. */
@media (max-width: 459px) {
    .am-modal--wide { width: calc(100vw - 80px); padding: 26px 14px 20px; }
    .am-modal--wide .am-field--captcha .g-recaptcha { transform-origin: center top; }
}
@media (max-width: 459px) and (min-width: 380px) { .am-modal--wide .am-field--captcha .g-recaptcha { transform: scale(.89); margin-bottom: -8px; } }
@media (max-width: 379px) and (min-width: 340px) { .am-modal--wide .am-field--captcha .g-recaptcha { transform: scale(.76); margin-bottom: -19px; } }
@media (max-width: 339px) { .am-modal--wide .am-field--captcha .g-recaptcha { transform: scale(.69); margin-bottom: -24px; } }
/* Fancybox считает позицию с учётом своего padding 20 px (у нас он обнулён) — окна стояли левее
   центра на 20–40 px на любом экране. Центрируем все окна. */
#fancybox-wrap { left: 50% !important; margin-left: 0 !important; transform: translateX(-50%); }
