/**
 * File: /wp-content/plugins/belofis-auth-gateway/public/assets/css/auth-gateway.css
 * @version 1.1.15
 *
 * Назначение:
 * - Локальные стили формы БелОфис ID.
 * - Без внешних шрифтов, CDN, emoji и картинок.
 *
 * История:
 * 1.0.0 — базовая форма.
 * 1.0.1 — стили для согласия, восстановления пароля, привязки телефона.
 * 1.1.8 — стили строки пароля и кнопки "Показать/Скрыть".
 * 1.1.11 — полировка страницы входа: скрытие внешнего заголовка,
 *          логотип темы, цветные вкладки, компактные мобильные отступы,
 *          аккуратная светлая и темная темы.
 * 1.1.12 — мобильный отступ страницы входа выровнен: убран двойной padding
 *          site-wrapper + auth-shell, карточка держит 16px от края экрана.
 * 1.1.13 — форма входа стала компактнее: логотип в карточке скрыт, поля и
 *          кнопки ниже, подписи phone/password визуально перенесены в поля.
 * 1.1.14 — вкладки стали понятнее: яркая только активная вкладка; подписи
 *          полей возвращены, но компактно, чтобы сценарий был очевиден.
 * 1.1.15 — добавлен аккуратный блок текущего телефона входа и форма смены
 *          телефона для уже вошедшего пользователя.
 */


body.belofis-auth-gateway-page .entry-header,
body.belofis-auth-gateway-page .page-header,
body.belofis-auth-gateway-page .entry-title,
body.belofis-auth-gateway-page .breadcrumbs,
body.belofis-auth-gateway-page .breadcrumb,
body.belofis-auth-gateway-page .rank-math-breadcrumb,
body.belofis-auth-gateway-page .yoast-breadcrumb,
body.belofis-auth-gateway-page .woocommerce-breadcrumb {
    display: none !important;
}

body.belofis-auth-gateway-page .site-main,
body.belofis-auth-gateway-page .entry-content,
body.belofis-auth-gateway-page .page-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.bag-auth-shell {
    --bag-bg: #ffffff;
    --bag-surface: #f8fafc;
    --bag-surface-strong: #eef4f6;
    --bag-text: #172033;
    --bag-muted: #667085;
    --bag-border: #d9e1ef;
    --bag-primary: #0f5f67;
    --bag-primary-dark: #0a454c;
    --bag-register: rgba(255, 167, 24, 0.14);
    --bag-register-strong: #ffa718;
    --bag-recover: rgba(229, 83, 83, 0.14);
    --bag-recover-strong: #e55353;
    --bag-danger: #b42318;
    --bag-success: #067647;
    max-width: 520px;
    margin: 1rem auto 1.3rem;
    padding: 0 16px;
    color: var(--bag-text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.bag-auth-card {
    background: var(--bag-bg);
    border: 1px solid var(--bag-border);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 18px 48px rgba(20, 32, 54, 0.08);
}

.bag-auth-brand {
    display: block;
    margin-bottom: 0.75rem;
}

.bag-auth-brand__copy {
    min-width: 0;
}

.bag-brand-mark,
.bag-brand-logo {
    display: none;
    align-items: center;
    justify-content: center;
    width: 0;
    height: 0;
    flex: 0 0 0;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(180, 35, 24, 0.12), rgba(21, 128, 61, 0.14));
    color: var(--bag-text);
    font-weight: 600;
    overflow: hidden;
}

.bag-brand-logo {
    padding: 6px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(217, 225, 239, 0.74);
}

.bag-brand-logo__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bag-brand-logo__image--dark {
    display: none;
}

.bag-auth-card h1 {
    margin: 0 0 0.22rem;
    color: var(--bag-text);
    font-size: 1.34rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.bag-lead,
.bag-small-note,
.bag-hint {
    color: var(--bag-muted);
}

.bag-lead {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.34;
}

.bag-tabs {
    display: grid;
    grid-template-columns: 1fr 1.18fr 1.05fr;
    gap: 0.38rem;
    margin: 0.75rem 0 0.82rem;
    padding: 0.32rem;
    background: var(--bag-surface);
    border: 1px solid rgba(217, 225, 239, 0.62);
    border-radius: 16px;
}

.bag-tab {
    min-height: 38px;
    border: 1px solid rgba(217, 225, 239, 0.72);
    border-radius: 11px;
    padding: 0.54rem 0.64rem;
    background: #ffffff;
    color: var(--bag-text);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.12;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.bag-tab:hover,
.bag-tab:focus {
    transform: translateY(-1px);
    outline: none;
    border-color: rgba(15, 95, 103, 0.22);
    box-shadow: 0 8px 18px rgba(20, 32, 54, 0.08);
}

.bag-tab.is-active[data-bag-tab="login"] {
    border-color: var(--bag-primary);
    background: var(--bag-primary);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 95, 103, 0.18);
}

.bag-tab.is-active[data-bag-tab="register"] {
    border-color: rgba(255, 167, 24, 0.90);
    background: var(--bag-register-strong);
    color: #102331;
    box-shadow: 0 10px 22px rgba(255, 167, 24, 0.20);
}

.bag-tab.is-active[data-bag-tab="recover"] {
    border-color: rgba(229, 83, 83, 0.78);
    background: var(--bag-recover-strong);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(229, 83, 83, 0.15);
}

.bag-panel {
    display: none;
}

.bag-panel.is-active {
    display: block;
}

.bag-form {
    display: grid;
    gap: 0.58rem;
}

.bag-step {
    display: grid;
    gap: 0.58rem;
}

.bag-step.is-hidden,
.bag-hp {
    display: none !important;
}

.bag-field {
    display: grid;
    gap: 0.24rem;
}

.bag-field label {
    color: var(--bag-text);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.18;
}

.bag-label-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
    border: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
}

.bag-field input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--bag-border);
    border-radius: 11px;
    padding: 0.54rem 0.76rem;
    color: var(--bag-text);
    background: #ffffff;
    font: inherit;
    box-sizing: border-box;
}

.bag-field input:focus {
    outline: none;
    border-color: var(--bag-primary);
    box-shadow: 0 0 0 3px rgba(15, 95, 103, 0.14);
}

.bag-password-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    align-items: stretch;
}

.bag-password-row input {
    min-width: 0;
}

.bag-password-toggle {
    min-width: 86px;
    border: 1px solid var(--bag-border);
    border-radius: 11px;
    padding: 0.54rem 0.76rem;
    background: var(--bag-surface);
    color: var(--bag-text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.bag-password-toggle:hover,
.bag-password-toggle:focus {
    border-color: var(--bag-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 95, 103, 0.12);
}

.bag-checkbox {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.45rem;
    align-items: start;
    padding: 0.52rem;
    border: 1px solid var(--bag-border);
    border-radius: 12px;
    background: var(--bag-surface);
    color: var(--bag-muted);
    font-size: 0.84rem;
    line-height: 1.3;
}

.bag-checkbox input {
    margin-top: 0.15rem;
}

.bag-checkbox a {
    color: var(--bag-primary);
    font-weight: 600;
}

.bag-btn {
    min-height: 42px;
    border: 0;
    border-radius: 11px;
    padding: 0.58rem 0.92rem;
    font-weight: 600;
    cursor: pointer;
}

.bag-auth-shell .bag-btn-primary {
    background: var(--bag-primary);
    color: #ffffff;
}

.bag-auth-shell .bag-btn-primary:hover,
.bag-auth-shell .bag-btn-primary:focus {
    background: var(--bag-primary-dark);
}

.bag-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.bag-status {
    min-height: 0;
    font-size: 0.86rem;
    color: var(--bag-muted);
}

.bag-status.is-error {
    color: var(--bag-danger);
}

.bag-status.is-success,
.bag-success-line {
    color: var(--bag-success);
    font-weight: 600;
}

.bag-status.is-info {
    color: var(--bag-muted);
}


.bag-small-note {
    margin: 0.45rem 0 0;
    font-size: 0.86rem;
    line-height: 1.35;
}

.bag-hint {
    font-size: 0.82rem;
    line-height: 1.35;
}

.bag-linked-phone {
    margin: 0.8rem 0 0.85rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--bag-border);
    border-radius: 14px;
    background: var(--bag-surface);
}

.bag-linked-phone__label {
    margin: 0 0 0.25rem;
    color: var(--bag-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.bag-linked-phone__value {
    color: var(--bag-text);
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.3;
}

.bag-linked-phone__note {
    margin: 0.25rem 0 0;
    color: var(--bag-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.bag-field input::placeholder {
    color: #8a98aa;
}

body.belofis-dark .bag-auth-shell,
body.theme-dark .bag-auth-shell,
body.dark .bag-auth-shell,
body.dark-mode .bag-auth-shell,
body[class*="dark"] .bag-auth-shell,
html.dark .bag-auth-shell,
html.theme-dark .bag-auth-shell,
html[data-theme="dark"] .bag-auth-shell {
    --bag-bg: #101827;
    --bag-surface: #172033;
    --bag-surface-strong: #1f2937;
    --bag-text: #f8fafc;
    --bag-muted: #c5d0e2;
    --bag-border: rgba(148, 163, 184, 0.24);
    --bag-primary: #38b6aa;
    --bag-primary-dark: #2c9f95;
    --bag-danger: #fca5a5;
    --bag-success: #6ee7b7;
}

body.belofis-auth-gateway-page.dark-mode,
body.belofis-auth-gateway-page.theme-dark,
body.belofis-auth-gateway-page[class*="dark"],
html.dark body.belofis-auth-gateway-page,
html.theme-dark body.belofis-auth-gateway-page,
html[data-theme="dark"] body.belofis-auth-gateway-page {
    background: #070b11 !important;
}

body.belofis-dark .bag-auth-card,
body.theme-dark .bag-auth-card,
body.dark .bag-auth-card,
body.dark-mode .bag-auth-card,
body[class*="dark"] .bag-auth-card,
html.dark .bag-auth-card,
html.theme-dark .bag-auth-card,
html[data-theme="dark"] .bag-auth-card {
    background: var(--bag-bg);
    border-color: var(--bag-border);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.34);
}

body.belofis-dark .bag-brand-logo,
body.theme-dark .bag-brand-logo,
body.dark .bag-brand-logo,
body.dark-mode .bag-brand-logo,
body[class*="dark"] .bag-brand-logo,
html.dark .bag-brand-logo,
html.theme-dark .bag-brand-logo,
html[data-theme="dark"] .bag-brand-logo {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(148, 163, 184, 0.22);
}

body.belofis-dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--light,
body.theme-dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--light,
body.dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--light,
body.dark-mode .bag-brand-logo.has-dark-logo .bag-brand-logo__image--light,
body[class*="dark"] .bag-brand-logo.has-dark-logo .bag-brand-logo__image--light,
html.dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--light,
html.theme-dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--light,
html[data-theme="dark"] .bag-brand-logo.has-dark-logo .bag-brand-logo__image--light {
    display: none;
}

body.belofis-dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--dark,
body.theme-dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--dark,
body.dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--dark,
body.dark-mode .bag-brand-logo.has-dark-logo .bag-brand-logo__image--dark,
body[class*="dark"] .bag-brand-logo.has-dark-logo .bag-brand-logo__image--dark,
html.dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--dark,
html.theme-dark .bag-brand-logo.has-dark-logo .bag-brand-logo__image--dark,
html[data-theme="dark"] .bag-brand-logo.has-dark-logo .bag-brand-logo__image--dark {
    display: block;
}

body.belofis-dark .bag-tab,
body.theme-dark .bag-tab,
body.dark .bag-tab,
body.dark-mode .bag-tab,
body[class*="dark"] .bag-tab,
html.dark .bag-tab,
html.theme-dark .bag-tab,
html[data-theme="dark"] .bag-tab {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--bag-border);
    color: var(--bag-text);
}

body.belofis-dark .bag-tab:hover,
body.theme-dark .bag-tab:hover,
body.dark .bag-tab:hover,
body.dark-mode .bag-tab:hover,
body[class*="dark"] .bag-tab:hover,
html.dark .bag-tab:hover,
html.theme-dark .bag-tab:hover,
html[data-theme="dark"] .bag-tab:hover,
body.belofis-dark .bag-tab:focus,
body.theme-dark .bag-tab:focus,
body.dark .bag-tab:focus,
body.dark-mode .bag-tab:focus,
body[class*="dark"] .bag-tab:focus,
html.dark .bag-tab:focus,
html.theme-dark .bag-tab:focus,
html[data-theme="dark"] .bag-tab:focus {
    border-color: rgba(56, 182, 170, 0.38);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

body.belofis-dark .bag-tabs,
body.theme-dark .bag-tabs,
body.dark .bag-tabs,
body.dark-mode .bag-tabs,
body[class*="dark"] .bag-tabs,
html.dark .bag-tabs,
html.theme-dark .bag-tabs,
html[data-theme="dark"] .bag-tabs,
body.belofis-dark .bag-checkbox,
body.theme-dark .bag-checkbox,
body.dark .bag-checkbox,
body.dark-mode .bag-checkbox,
body[class*="dark"] .bag-checkbox,
html.dark .bag-checkbox,
html.theme-dark .bag-checkbox,
html[data-theme="dark"] .bag-checkbox,
body.belofis-dark .bag-password-toggle,
body.theme-dark .bag-password-toggle,
body.dark .bag-password-toggle,
body.dark-mode .bag-password-toggle,
body[class*="dark"] .bag-password-toggle,
html.dark .bag-password-toggle,
html.theme-dark .bag-password-toggle,
html[data-theme="dark"] .bag-password-toggle {
    background: var(--bag-surface);
    border-color: var(--bag-border);
}

body.belofis-dark .bag-field input,
body.theme-dark .bag-field input,
body.dark .bag-field input,
body.dark-mode .bag-field input,
body[class*="dark"] .bag-field input,
html.dark .bag-field input,
html.theme-dark .bag-field input,
html[data-theme="dark"] .bag-field input {
    background: #0f172a;
    color: var(--bag-text);
    border-color: var(--bag-border);
}

body.belofis-dark .bag-field input::placeholder,
body.theme-dark .bag-field input::placeholder,
body.dark .bag-field input::placeholder,
body.dark-mode .bag-field input::placeholder,
body[class*="dark"] .bag-field input::placeholder,
html.dark .bag-field input::placeholder,
html.theme-dark .bag-field input::placeholder,
html[data-theme="dark"] .bag-field input::placeholder {
    color: #94a3b8;
}

@media (max-width: 760px) {
    body.belofis-auth-gateway-page .site-wrapper {
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    .bag-auth-shell {
        max-width: 100%;
        margin: 0.75rem auto 1rem;
        padding-right: 0;
        padding-left: 0;
    }

    .bag-auth-card {
        padding: 0.9rem;
        border-radius: 18px;
    }

    .bag-tabs {
        grid-template-columns: 1fr;
        gap: 0.38rem;
    }

    .bag-tab {
        min-height: 40px;
    }

    .bag-auth-brand {
        margin-bottom: 0.65rem;
    }

    .bag-brand-mark,
    .bag-brand-logo {
        display: none;
    }

    .bag-auth-card h1 {
        font-size: 1.24rem;
    }

    .bag-lead {
        font-size: 0.88rem;
    }
}

@media (max-width: 420px) {
    .bag-auth-shell {
        padding-right: 0;
        padding-left: 0;
    }

    .bag-password-row {
        grid-template-columns: 1fr;
    }

    .bag-password-toggle {
        width: 100%;
    }
}
