/* ============================================================
   Auth Modal — поддерживает dark/light через CSS-переменные
   ============================================================ */

/* Кнопка «Войти» в хедере */
.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--basic-brand-bg-accent);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: var(--type-size-xs);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.18s;
    white-space: nowrap;
}

.btn-login:hover {
    opacity: 0.85;
}

/* Оверлей */
.auth-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--background-overlay);
    backdrop-filter: blur(4px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal-overlay.is-open {
    display: flex;
}

/* Окно */
.auth-modal {
    background: var(--background-bg-primary);
    border: 1px solid var(--border-alpha-subtle);
    border-radius: 18px;
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: amSlideUp 0.22s ease;
}

@keyframes amSlideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Закрыть */
.auth-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--states-primary-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--icon-secondary);
    cursor: pointer;
    transition: background 0.15s;
}

.auth-modal__close:hover {
    background: var(--states-primary-tertiary-hover);
}

.auth-modal__close svg {
    width: 14px;
    height: 14px;
}

/* Заголовок */
.auth-modal__title {
    font-size: var(--type-size-xl-desktop);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    margin: 0 0 6px;
}

.auth-modal__sub {
    font-size: var(--type-size-sm);
    color: var(--text-tertiary);
    margin: 0 0 24px;
}

/* Блок провайдера (те же стили что и в slp) */
.am-provider {
    border-radius: 12px;
    padding: 16px;
}

.am-provider--telegram {
    background: rgba(42, 171, 238, 0.06);
    border: 1px solid rgba(42, 171, 238, 0.18);
    margin-bottom: 12px;
}

.am-provider--yandex {
    background: rgba(248, 66, 68, 0.05);
    border: 1px solid rgba(248, 66, 68, 0.15);
}

.am-provider__label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

.am-provider__label svg {
    width: 13px;
    height: 13px;
    opacity: 0.5;
}

.am-widget-wrap {
    display: flex;
    justify-content: center;
    min-height: 44px;
    align-items: center;
}

.am-widget-loading {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: var(--type-size-xs);
}

.am-widget-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-alpha-light);
    border-top-color: #2aabee;
    border-radius: 50%;
    animation: amSpin 0.8s linear infinite;
}

@keyframes amSpin {
    to { transform: rotate(360deg); }
}

.am-widget-error {
    display: none;
    margin-top: 8px;
    padding: 9px 12px;
    background: rgba(220, 38, 38, 0.07);
    border: 1px solid rgba(220, 38, 38, 0.18);
    border-radius: 8px;
    font-size: var(--type-size-2xs);
    color: #dc2626;
}

html.dark .am-widget-error {
    color: #fca5a5;
}

.am-fallback {
    margin-top: 10px;
    font-size: var(--type-size-2xs);
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.6;
}

.am-fallback a {
    color: #2aabee;
    text-decoration: none;
    font-weight: 500;
}

.am-fallback a:hover {
    text-decoration: underline;
}

/* Разделитель */
.am-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 12px;
    color: var(--text-disabled);
    font-size: 11px;
    letter-spacing: 0.05em;
}

.am-divider::before,
.am-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-alpha-light);
}

/* Кнопка Яндекс */
.am-btn-yandex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #f84244, #d72d2f);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: var(--type-size-sm);
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(248, 66, 68, 0.25);
    transition: opacity 0.2s, transform 0.15s;
}

.am-btn-yandex:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.am-btn-yandex svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ─── Панели ─────────────────────────────────────────────── */

.am-panel--hidden {
    display: none;
}

/* ─── Кнопка «Назад» ─────────────────────────────────────── */

.am-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: var(--type-size-xs);
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.am-back-btn:hover {
    color: var(--text-primary);
}

.am-back-btn svg {
    width: 14px;
    height: 14px;
}

/* ─── Кнопка-ссылка «Войти через бота» ──────────────────── */

.am-link-btn {
    background: none;
    border: none;
    color: #2aabee;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    font-weight: 500;
    text-decoration: none;
}

.am-link-btn:hover {
    text-decoration: underline;
}

/* ─── Шаги ───────────────────────────────────────────────── */

.am-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 20px 0;
}

.am-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.am-step__num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--states-primary-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.am-step__body {
    padding-top: 3px;
}

.am-step__body strong {
    display: block;
    font-size: var(--type-size-sm);
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2px;
}

.am-step__body p {
    margin: 0;
    font-size: var(--type-size-2xs);
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── Загрузка инициализации бота ────────────────────────── */

.am-bot-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 0;
    color: var(--text-secondary);
    font-size: var(--type-size-xs);
}

/* ─── Кнопка «Открыть бота» ──────────────────────────────── */

.am-btn-open-bot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    background: linear-gradient(135deg, #2aabee, #1a8bc7);
    border-radius: 10px;
    color: #fff;
    font-size: var(--type-size-sm);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(42, 171, 238, 0.28);
    transition: opacity 0.2s, transform 0.15s;
    margin-bottom: 14px;
}

.am-btn-open-bot:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.am-btn-open-bot svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

/* ─── Статус бота ────────────────────────────────────────── */

.am-bot-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: var(--type-size-xs);
    margin-bottom: 10px;
}

.am-bot-status--pending {
    background: rgba(42, 171, 238, 0.07);
    border: 1px solid rgba(42, 171, 238, 0.2);
    color: var(--text-primary);
}

.am-bot-status--confirmed {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

html.dark .am-bot-status--confirmed {
    color: #4ade80;
}

.am-bot-status--cancelled {
    background: rgba(220, 38, 38, 0.07);
    border: 1px solid rgba(220, 38, 38, 0.18);
    color: #dc2626;
}

html.dark .am-bot-status--cancelled {
    color: #fca5a5;
}

.am-bot-status--expired {
    background: rgba(234, 179, 8, 0.07);
    border: 1px solid rgba(234, 179, 8, 0.2);
    color: #92400e;
}

html.dark .am-bot-status--expired {
    color: #fbbf24;
}

.am-bot-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(42, 171, 238, 0.25);
    border-top-color: #2aabee;
    border-radius: 50%;
    animation: amSpin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ─── «Открыть полную страницу» ─────────────────────────── */

.am-new-link {
    display: block;
    text-align: center;
    font-size: var(--type-size-2xs);
    color: var(--text-tertiary);
    margin-bottom: 10px;
    text-decoration: none;
}

.am-new-link:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

/* ─── Кнопка «Получить новую ссылку» ────────────────────── */

.am-btn-retry {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    padding: 10px 16px;
    background: var(--states-primary-tertiary);
    border: 1px solid var(--border-alpha-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: var(--type-size-sm);
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.15s;
}

.am-btn-retry:hover {
    background: var(--states-primary-tertiary-hover);
}

.am-btn-retry svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ─── Футер с таймером ───────────────────────────────────── */

.am-bot-footer {
    text-align: center;
    font-size: var(--type-size-2xs);
    color: var(--text-secondary);
    margin-top: 4px;
}
