/* Компонент входа (layout/auth/component.php, js/auth.js). Всё под .w-auth-root — не задевает остальной сайт. */
.w-auth-root {
    --w-dark: #455a64; --w-green: #3a9140; --w-green-h: #2f7a35; --w-orange: #ff9f00;
    --w-link: #2156b0; --w-text: #2b2b2b; --w-muted: #6b7280; --w-line: #dfe3e6; --w-bg: #f4f6f7; --w-err: #d93025;
    font-family: Inter, system-ui, sans-serif; color: var(--w-text); font-size: 14px; line-height: 1.45;
}
.w-auth-root *, .w-auth-root *::before, .w-auth-root *::after { box-sizing: border-box; }
.w-auth-root .w-auth-hidden { display: none !important; }

/* оверлей */
.w-auth-overlay { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 16px; }
.w-auth-backdrop { position: absolute; inset: 0; background: rgba(20, 28, 33, .55); }
.w-auth-overlay .w-auth { position: relative; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
body.w-auth-lock { overflow: hidden; }

/* карточка */
.w-auth { width: 100%; max-width: 420px; background: #fff; border-radius: 12px; padding: 28px 28px 22px; margin: 0 auto; }
.w-auth-inline .w-auth { border: 1px solid var(--w-line); margin: 24px auto 40px; }
.w-auth-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; background: none; border-radius: 50%; color: #777; font-size: 20px; cursor: pointer; }
.w-auth-close:hover { background: var(--w-bg); }
.w-auth-back { border: 0; background: none; color: var(--w-muted); font: inherit; font-size: 14px; padding: 0; margin: -4px 0 12px; cursor: pointer; }
.w-auth-back:hover { color: var(--w-text); }
.w-auth-title { font-size: 22px; font-weight: 600; margin: 0 0 6px; color: var(--w-text); line-height: 1.25; }
.w-auth-sub { font-size: 14px; color: var(--w-muted); margin: 0 0 20px; }
.w-auth-sub b { color: var(--w-text); white-space: nowrap; }

/* поля */
.w-auth-field { margin-bottom: 14px; }
.w-auth-label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; color: var(--w-text); }
.w-auth-root .w-auth-input { display: block; width: 100%; height: 48px; border: 1px solid #cfd5d9; border-radius: 8px; background: #fff;
    font: inherit; font-size: 16px; color: var(--w-text); padding: 0 14px; outline: 0; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.w-auth-root .w-auth-input:focus { border-color: var(--w-dark); box-shadow: 0 0 0 3px rgba(69, 90, 100, .15); }
.w-auth-root .w-auth-input.w-auth-err { border-color: var(--w-err); box-shadow: 0 0 0 3px rgba(217, 48, 37, .12); }
.w-auth-pass { position: relative; }
.w-auth-pass .w-auth-input { padding-right: 46px; }
.w-auth-eye { position: absolute; top: 0; right: 0; height: 48px; width: 46px; border: 0; background: none; color: #888; cursor: pointer; }

/* intlTelInput внутри компонента */
.w-auth-root .intl-tel-input { display: block; width: 100%; }
.w-auth-root .intl-tel-input .flag-container { height: 48px; }
.w-auth-root .intl-tel-input.separate-dial-code .selected-flag { background: #f4f6f7; border-radius: 8px 0 0 8px; border-right: 1px solid #e5e8ea; }
.w-auth-root .intl-tel-input .country-list { z-index: 3; max-width: 360px; white-space: normal; }

/* кнопки и ссылки */
.w-auth-row { display: flex; justify-content: flex-end; margin: -4px 0 16px; font-size: 13px; }
.w-auth-root .w-auth-link { color: var(--w-link); text-decoration: none; cursor: pointer; background: none; border: 0; font: inherit; padding: 0; }
.w-auth-root .w-auth-link:hover { text-decoration: underline; }
.w-auth-root .w-auth-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; margin: 0 0 10px;
    border-radius: 8px; border: 0; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; transition: background .15s; }
.w-auth-btn-primary { background: var(--w-green); color: #fff; }
.w-auth-btn-primary:hover { background: var(--w-green-h); color: #fff; }
.w-auth-btn[disabled], .w-auth-btn.w-auth-busy { opacity: .6; cursor: default; }
.w-auth-btn-outline { background: #fff; color: var(--w-text); border: 1px solid #cfd5d9 !important; }
.w-auth-btn-outline:hover { background: var(--w-bg); }
.w-auth-root .w-auth-btn-google { background: #fff; color: #3c4043; border: 1px solid #dadce0; font-weight: 500; font-size: 15px; }
.w-auth-root .w-auth-btn-google:hover { background: #f8f9fa; color: #3c4043; text-decoration: none; }
.w-auth-g { width: 18px; height: 18px; }
.w-auth-or { display: flex; align-items: center; gap: 12px; color: #9aa1a7; font-size: 12px; margin: 8px 0 18px; }
.w-auth-or::before, .w-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--w-line); }
.w-auth-foot { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--w-line); font-size: 13px; color: var(--w-muted); text-align: center; }
.w-auth-legal { font-size: 12px; color: var(--w-muted); margin: 4px 0 0; text-align: center; }

/* сообщения */
.w-auth-alert { display: flex; gap: 10px; font-size: 13px; line-height: 1.4; padding: 10px 12px; border-radius: 8px; margin: 0 0 14px; background: #fdecea; color: #8c1d18; }
.w-auth-alert i { margin-top: 2px; }
.w-auth-ok { color: var(--w-green); font-size: 13px; margin: 0 0 10px; }

/* код */
.w-auth-code { display: flex; gap: 10px; justify-content: space-between; margin: 4px 0 18px; }
.w-auth-root .w-auth-digit { width: 100%; max-width: 58px; height: 58px; text-align: center; font: inherit; font-size: 24px; font-weight: 600;
    border: 1px solid #cfd5d9; border-radius: 8px; outline: 0; padding: 0; background: #fff; color: var(--w-text); }
.w-auth-root .w-auth-digit:focus { border-color: var(--w-dark); box-shadow: 0 0 0 3px rgba(69, 90, 100, .15); }
.w-auth-code.w-auth-err .w-auth-digit { border-color: var(--w-err); }
.w-auth-resend { font-size: 13px; color: var(--w-muted); text-align: center; margin: 4px 0 6px; }

/* готово */
.w-auth-center { text-align: center; }
.w-auth-done-ico { width: 64px; height: 64px; border-radius: 50%; background: #e7f4e8; color: var(--w-green); display: flex; align-items: center; justify-content: center; font-size: 30px; margin: 4px auto 14px; }
.w-auth-passbox { background: var(--w-bg); border-radius: 8px; padding: 12px 14px; font-size: 14px; margin: 14px 0 12px; }
.w-auth-passbox .fa-key { color: var(--w-orange); margin-right: 4px; }
.w-auth-setpass-toggle { margin-bottom: 14px !important; }
.w-auth-setpass { margin-top: -4px; }
.w-auth-continue { margin-top: 6px !important; }

/* телефон: оверлей — лист снизу */
@media (max-width: 520px) {
    .w-auth-overlay { align-items: flex-end; padding: 0; }
    .w-auth-overlay .w-auth { max-width: none; border-radius: 16px 16px 0 0; padding: 22px 18px 24px; max-height: 92vh; }
    .w-auth-inline .w-auth { border: 0; padding: 8px 0 24px; margin-top: 0; }
    .w-auth-code { gap: 8px; }
}

/* пока открыт вход — прячем кнопку онлайн-чата (Dashly/Carrot quest), она перекрывает форму */
body.w-auth-lock #carrotquest-messenger-collapsed-container { display: none !important; }
