/* ══════════════════════════════════════════════════════════════════════ */
/* Abitrium — вход (portal layout)                                           */
/* ══════════════════════════════════════════════════════════════════════ */

:root {
    --ln-navy:  #071b4a;
    --ln-blue:  #1d5bff;
    --ln-text:  #0f172a;
    --ln-sub:   #64748b;
    --ln-line:  rgba(7, 27, 74, 0.1);
    --ln-white: #ffffff;
    --ln-radius: 14px;
    --ln-touch: 3rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body.login-page {
    min-height: 100dvh;
    min-height: 100svh;
    margin: 0;
    font-family: "Inter", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ln-text);
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: center;
    justify-content: center;
    padding:
        max(1.25rem, env(safe-area-inset-top))
        max(1rem, env(safe-area-inset-right))
        max(1.25rem, env(safe-area-inset-bottom))
        max(1rem, env(safe-area-inset-left));
    position: relative;
    overflow-x: hidden;
}

/* ── Фон ─────────────────────────────────────────────────────────────── */
.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 90% 70% at 50% -10%, #2563eb 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(19, 184, 178, 0.35) 0%, transparent 50%),
        linear-gradient(165deg, #0c2d6b 0%, #071b4a 55%, #030d22 100%);
}

.login-bg__mesh {
    position: absolute;
    inset: 0;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

/* ── Центральная колонка ─────────────────────────────────────────────── */
.login-portal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 26rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
}

.login-portal__brand {
    text-align: center;
}

.login-portal__logo {
    width: min(72vw, 13.5rem);
    height: auto;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 4px 24px rgba(0, 0, 0, 0.25));
}

/* ── Карточка формы ──────────────────────────────────────────────────── */
.login-panel {
    width: 100%;
    background: var(--ln-white);
    border-radius: var(--ln-radius);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow:
        0 0 0 1px rgba(7, 27, 74, 0.04),
        0 16px 48px rgba(0, 0, 0, 0.22),
        0 4px 12px rgba(7, 27, 74, 0.08);
    overflow: hidden;
}

.login-panel__head {
    padding: 1.25rem 1.35rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(7, 27, 74, 0.06);
    background: #fff;
}

.login-panel__title {
    margin: 0 0 0.2rem;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ln-navy);
    letter-spacing: -0.02em;
}

.login-panel__sub {
    margin: 0;
    font-size: 0.875rem;
    color: var(--ln-sub);
    font-weight: 500;
}

.login-panel__body {
    padding: 1.25rem 1.35rem 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Уведомления ─────────────────────────────────────────────────────── */
.login-notice {
    display: flex;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.22);
    color: #92400e;
}

.login-notice__ico {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 8px;
    background: rgba(245, 158, 11, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.login-notice strong {
    display: block;
    font-weight: 700;
    font-size: 0.8125rem;
    margin-bottom: 0.1rem;
}

.login-notice p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.35;
}

.login-alert {
    display: flex;
    gap: 0.6rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    border: 1px solid transparent;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-alert--danger  { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.login-alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.login-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.login-alert--info,
.login-alert--farewell { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.login-alert__ico { flex-shrink: 0; font-size: 0.85rem; margin-top: 0.05rem; }
.login-alert__text { line-height: 1.45; white-space: pre-line; }
.login-alert.is-closing { opacity: 0; transform: translateY(-4px); }

.login-contact {
    width: 100%;
    min-height: var(--ln-touch);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0 1rem;
    border-radius: 10px;
    border: 1px solid rgba(180, 83, 9, 0.3);
    background: #fffbeb;
    color: #92400e;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

/* ── Поля ──────────────────────────────────────────────────────────── */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.login-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ln-sub);
}

.login-input-wrap {
    display: flex;
    align-items: center;
    min-height: var(--ln-touch);
    background: #f8fafc;
    border: 1px solid var(--ln-line);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-input-wrap:focus-within {
    background: #fff;
    border-color: var(--ln-blue);
    box-shadow: 0 0 0 3px rgba(29, 91, 255, 0.14);
}

.login-input-ico {
    flex-shrink: 0;
    width: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

.login-input-wrap:focus-within .login-input-ico {
    color: var(--ln-blue);
}

.login-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0 0.75rem 0 0;
    font-size: 1rem;
    font-family: inherit;
    color: var(--ln-text);
    outline: none;
}

.login-input::placeholder {
    color: #94a3b8;
}

.login-pwd-toggle {
    flex-shrink: 0;
    width: 2.75rem;
    min-height: var(--ln-touch);
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-pwd-toggle:hover { color: var(--ln-blue); }

.login-caps {
    margin: 0.15rem 0 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
}

/* ── Кнопка входа ──────────────────────────────────────────────────── */
.login-submit {
    width: 100%;
    min-height: var(--ln-touch);
    margin-top: 0.15rem;
    padding: 0 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #1d5bff 0%, #0f43d4 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(29, 91, 255, 0.35);
    transition: box-shadow 0.15s ease, opacity 0.15s ease;
}

.login-submit:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(29, 91, 255, 0.42);
}

.login-submit:disabled {
    opacity: 0.85;
    cursor: not-allowed;
}

.login-submit__spin {
    width: 0.9rem;
    height: 0.9rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: ln-spin 0.65s linear infinite;
}

.login-submit.is-loading .login-submit__spin {
    display: inline-block;
}

@keyframes ln-spin {
    to { transform: rotate(360deg); }
}

/* ── Подвал ──────────────────────────────────────────────────────────── */
.login-portal__foot {
    width: 100%;
    text-align: center;
}

.login-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.login-meta__pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.9);
    font-variant-numeric: tabular-nums;
}

.login-meta__copy {
    font-size: 0.75rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.42);
}

/* ── Модалка ─────────────────────────────────────────────────────────── */
.login-modal {
    border: none;
    border-radius: var(--ln-radius);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(7, 27, 74, 0.2);
}

.login-modal__header {
    background: #f8fafc;
    border-bottom: 1px solid var(--ln-line);
    padding: 1rem 1.15rem;
}

.login-modal__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--ln-navy);
}

.login-modal__body { padding: 1.15rem; }

.login-modal__footer {
    border-top: 1px solid var(--ln-line);
    background: #f8fafc;
    padding: 0.75rem 1.15rem;
}

.login-modal__close {
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--ln-line);
    background: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ln-sub);
    cursor: pointer;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--ln-line);
}

.contact-row__ico {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: rgba(29, 91, 255, 0.08);
    color: var(--ln-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
}

.contact-row strong {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--ln-navy);
}

.contact-row p {
    margin: 0.1rem 0 0;
    font-size: 0.8125rem;
    color: var(--ln-sub);
}

.contact-row a {
    color: var(--ln-blue);
    font-weight: 600;
    text-decoration: none;
}

/* ── Планшет ─────────────────────────────────────────────────────────── */
@media (min-width: 600px) and (max-width: 1024px) {
    .login-portal {
        max-width: 28rem;
    }

    .login-portal__logo {
        width: 14rem;
    }

    .login-panel__body {
        padding: 1.35rem 1.5rem 1.5rem;
    }
}

/* ── Десктоп ─────────────────────────────────────────────────────────── */
@media (min-width: 1025px) {
    .login-portal {
        max-width: 27rem;
        gap: 1.5rem;
    }

    .login-portal__logo {
        width: 14.5rem;
    }

    .login-panel__title {
        font-size: 1.25rem;
    }
}

/* ── Маленький телефон ───────────────────────────────────────────────── */
@media (max-width: 380px) {
    .login-panel__head,
    .login-panel__body {
        padding-left: 1.1rem;
        padding-right: 1.1rem;
    }

    .login-portal__logo {
        width: 10.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
