/* ==========================================================
   Страницы входа: /login и вход в сервис по API (OAuth2).
   Строятся на компонентах style.css (surface, btn, input, alert).
========================================================== */

.auth-main{
    flex:1;
    display:flex;
    justify-content:center;
    align-items:flex-start;
    padding:64px 16px 80px;
}

.auth-shell{
    width:100%;
    /* поле формы — 352px: при большей ширине виджет SmartCaptcha обрезается справа */
    max-width:410px;
}

.auth-shell-wide{
    max-width:480px;
}

.auth-card{
    box-shadow:var(--shadow);
    overflow:hidden;
}

.auth-head{
    padding:28px 28px 0;
}

.auth-head h1{
    font-size:24px;
    font-weight:700;
}

.auth-lead{
    margin:6px 0 0;
    font-size:14px;
    color:var(--text-light);
}

.auth-body{
    padding:24px 28px 28px;
}

.auth-body .form{
    gap:18px;
}

.auth-foot{
    padding:16px 28px;
    border-top:1px solid var(--border);
    background:var(--surface-2);
    font-size:13.5px;
    color:var(--text-light);
}

.auth-foot a{
    color:var(--primary);
    font-weight:600;
}

.auth-foot a:hover{
    color:var(--primary-hover);
}

/* ---------- сообщение об ошибке ---------- */

.auth-alert{
    align-items:center;
    margin-bottom:20px;
    padding:12px 14px;
    font-size:14px;
    line-height:1.45;
}

.auth-alert span{
    color:var(--text);
}

.auth-alert i{
    flex-shrink:0;
    margin-top:0;
}

/* ---------- поля ---------- */

.auth-body .input{
    min-height:50px;
    font-size:15px;
}

.auth-pass{
    position:relative;
}

.auth-pass .input{
    padding-right:52px;
}

.auth-pass-toggle{
    position:absolute;
    top:50%;
    right:6px;
    transform:translateY(-50%);
    width:40px;
    height:40px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:0;
    border-radius:10px;
    background:transparent;
    color:var(--text-muted);
    transition:var(--transition-fast);
}

.auth-pass-toggle:hover{
    background:var(--primary-soft);
    color:var(--primary);
}

.auth-pass-toggle svg{
    width:18px;
    height:18px;
}

/* Виджет SmartCaptcha на узких экранах шире поля: обрезаем его по краю поля
   и рисуем рамку поверх, чтобы обрез не был виден */
.auth-captcha{
    position:relative;
    height:100px;
    overflow:hidden;
    border-radius:12px;
}

.auth-captcha::after{
    content:"";
    position:absolute;
    inset:0;
    border:1px solid var(--border);
    border-radius:12px;
    pointer-events:none;
}

.auth-submit{
    width:100%;
    min-height:50px;
    font-size:15px;
}

/* ---------- «или» и кнопки провайдеров ---------- */

.auth-or{
    display:flex;
    align-items:center;
    gap:12px;
    margin:22px 0 16px;
    font-size:12.5px;
    color:var(--text-muted);
}

.auth-or::before,
.auth-or::after{
    content:"";
    flex:1;
    height:1px;
    background:var(--border);
}

.auth-social{
    display:grid;
    grid-auto-flow:column;
    grid-auto-columns:minmax(0,1fr);
    gap:10px;
}

.soc-btn{
    width:100%;
    min-height:48px;
    border-color:var(--border);
}

.soc-btn:hover{
    border-color:#d3d8eb;
    background:var(--surface-3);
    color:var(--text);
}

.soc-mark{
    flex-shrink:0;
}

/* ---------- программа, которая запрашивает вход (OAuth) ---------- */

.auth-app{
    display:flex;
    align-items:center;
    gap:12px;
    margin:0 0 18px;
    padding:12px 14px;
    border:1px solid var(--border);
    border-radius:var(--radius);
    background:var(--surface-3);
}

.auth-app-mark{
    width:40px;
    height:40px;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:11px;
    background:var(--primary-soft);
    color:var(--primary);
    font-weight:700;
    font-size:17px;
}

.auth-app-logo{
    display:block;
    object-fit:contain;
    background:#fff;
    border:1px solid var(--border);
}

.auth-app-name{
    font-weight:700;
    line-height:1.3;
    word-break:break-word;
}

.auth-app-note{
    font-size:13px;
    color:var(--text-muted);
}

/* ---------- подтверждение доступа ---------- */

.auth-scopes{
    margin:0 0 20px;
    padding:0;
    list-style:none;
    border:1px solid var(--border);
    border-radius:var(--radius);
}

.auth-scope{
    display:flex;
    gap:12px;
    padding:14px 16px;
}

.auth-scope + .auth-scope{
    border-top:1px solid var(--border);
}

.auth-scope > i{
    flex-shrink:0;
    align-self:flex-start;
    display:flex;
    height:20px;
    width:20px;
    margin-top:1px;
    color:var(--primary);
}

.auth-scope > i svg{
    width:20px;
    height:20px;
}

.auth-scope strong{
    display:block;
    font-size:14px;
}

.auth-scope small{
    display:block;
    margin-top:2px;
    font-size:13px;
    line-height:1.45;
    color:var(--text-light);
}

.auth-data{
    display:grid;
    gap:4px;
    margin:10px 0 0;
    padding:0;
    list-style:none;
    font-size:13px;
}

.auth-data li{
    display:flex;
    gap:8px;
    color:var(--text);
}

.auth-data li::before{
    content:"";
    flex-shrink:0;
    width:5px;
    height:5px;
    margin-top:8px;
    border-radius:50%;
    background:var(--primary);
}

.auth-data span{
    color:var(--text-light);
}

.auth-chips{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin-top:10px;
}

.auth-chip{
    padding:4px 9px;
    border-radius:var(--radius-round);
    background:var(--surface-3);
    border:1px solid var(--border);
    font-size:12px;
    font-weight:600;
    color:var(--text-light);
}

.auth-chip.is-current{
    background:var(--primary-soft);
    border-color:transparent;
    color:var(--primary);
}

.auth-more{
    margin-top:6px;
    font-size:12px;
    color:var(--text-muted);
}

.auth-user{
    display:flex;
    align-items:center;
    gap:12px;
    margin:0 0 20px;
}

.auth-ava{
    width:38px;
    height:38px;
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    background:var(--primary);
    color:#fff;
    font-weight:700;
}

.auth-user-name{
    font-weight:700;
    line-height:1.3;
}

.auth-user-note{
    font-size:13px;
    color:var(--text-muted);
}

.auth-actions{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);
    gap:10px;
}

.auth-actions form{
    margin:0;
}

.auth-actions .btn{
    width:100%;
    min-height:50px;
}

/* ---------- телефон ---------- */

@media (max-width:520px){
    .auth-main{
        padding:24px 14px 44px;
    }

    .auth-head{
        padding:22px 20px 0;
    }

    .auth-head h1{
        font-size:21px;
    }

    .auth-body{
        padding:20px 20px 22px;
    }

    .auth-foot{
        padding:14px 20px;
    }

    .auth-actions{
        grid-template-columns:minmax(0,1fr);
    }

    .auth-actions form:first-child{
        order:2;
    }
}

@media (max-width:360px){
    .auth-social{
        grid-auto-flow:row;
    }
}
