/**
 * KENVARA login page.
 * Файл: app/assets/css/login.css
 * Базовая версия: 2026-09-09-ui-reset.1
 *
 * Только уникальная композиция страницы login.php.
 * Общие auth-компоненты находятся в app.css.
 */

.login-page {
    overflow-x: hidden;
    background: #f7f8fc;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(430px, 33vw);
    width: 100%;
    min-height: 100vh;
}

/* Product side */

.login-product {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 38px clamp(42px, 5.2vw, 96px) 32px;
    background:
        radial-gradient(circle at 18% 14%, rgba(101, 75, 238, 0.075), transparent 31%),
        radial-gradient(circle at 84% 82%, rgba(49, 186, 143, 0.055), transparent 27%),
        #f8f9fd;
}

.login-product-inner {
    width: min(100%, 980px);
    margin: 0 auto;
}

.login-product-logo {
    display: inline-flex;
    margin: 0 0 26px;
}

.login-product-logo img {
    width: 232px;
    max-width: 100%;
}

.login-product-copy {
    max-width: 980px;
}

.login-product-kicker {
    margin: 0 0 12px;
    color: #6a58dc;
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    line-height: 1.35;
    letter-spacing: 0.08em;
}

.login-product-copy h2 {
    margin: 0;
    color: #111c36;
    font-size: clamp(30px, 2.15vw, 42px);
    font-weight: var(--font-weight-semibold);
    line-height: 1.02;
    letter-spacing: -0.035em;
}

.login-product-copy h2 span {
    color: #654bee;
}

.login-product-lead {
    max-width: 760px;
    margin: 16px 0 0;
    color: #303a52;
    font-size: var(--font-size-base);
    line-height: 1.55;
}

.login-product-points {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 26px;
}

.login-product-point {
    min-width: 0;
}

.login-product-point-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 10px;
    border-radius: 4px;
    background: linear-gradient(145deg, #f0edff, #e8e5ff);
    box-shadow: inset 0 0 0 1px rgba(101, 75, 238, 0.07);
    color: #654bee;
}

.login-product-point-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-product-point strong,
.login-product-point div > span {
    display: block;
    font-size: var(--font-size-base);
}

.login-product-point strong {
    margin-bottom: 5px;
    color: #15203a;
    font-weight: var(--font-weight-semibold);
    line-height: 1.35;
}

.login-product-point div > span {
    color: #59647b;
    line-height: 1.45;
}

/*
 * Миниатюра интерфейса - это иллюстрация, а не рабочий UI.
 * Мелкие размеры шрифта внутри .login-product-demo не входят в типографический канон приложения.
 */

.login-product-demo {
    position: relative;
    width: min(100%, 790px);
    margin: 28px auto 0;
}

.login-demo-browser {
    position: relative;
    z-index: 2;
    padding: 10px 10px 12px;
    border: 1px solid #242a38;
    border-radius: 4px 4px 4px 4px;
    background: #181d28;
    box-shadow: 0 22px 44px rgba(32, 38, 56, 0.18);
}

.login-demo-browser::before {
    position: absolute;
    top: 4px;
    left: 50%;
    width: 38px;
    height: 3px;
    border-radius: 4px;
    background: #384052;
    content: "";
    transform: translateX(-50%);
}

.login-demo-screen {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    height: 270px;
    overflow: hidden;
    border-radius: 4px 4px 4px 4px;
    background: #f4f6fb;
}

.login-demo-sidebar {
    padding: 14px 10px;
    background: #111a32;
    color: #d9deeb;
}

.login-demo-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 4px 17px;
    color: #ffffff;
    font-size: 9px;
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.04em;
}

.login-demo-brand img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.login-demo-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 25px;
    margin: 2px 0;
    padding: 0 8px;
    border-radius: 4px;
    color: #b8c0d2;
    font-size: 7px;
}

.login-demo-nav i {
    width: 6px;
    height: 6px;
    border: 1px solid currentColor;
    border-radius: 2px;
    opacity: 0.75;
}

.login-demo-nav--active {
    background: #5140b9;
    color: #ffffff;
}

.login-demo-main {
    min-width: 0;
    padding: 17px 18px;
}

.login-demo-topline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.login-demo-topline strong {
    display: block;
    color: #1b2439;
    font-size: 13px;
    line-height: 1.2;
}

.login-demo-topline span {
    display: block;
    margin-top: 3px;
    color: #8b94a8;
    font-size: 7px;
}

.login-demo-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e9e6ff;
    color: #6049db;
    font-size: 8px;
    font-weight: var(--font-weight-bold);
}

.login-demo-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.login-demo-kpis > div {
    min-width: 0;
    padding: 10px;
    border: 1px solid #e8eaf1;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(38, 45, 66, 0.025);
}

.login-demo-kpis span {
    display: block;
    overflow: hidden;
    color: #8d95a8;
    font-size: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-demo-kpis b {
    display: block;
    margin-top: 5px;
    color: #1b2439;
    font-size: 13px;
    white-space: nowrap;
}

.login-demo-kpis em {
    display: block;
    margin-top: 3px;
    color: #1eaf74;
    font-size: 6px;
    font-style: normal;
    font-weight: var(--font-weight-bold);
}

.login-demo-grid {
    display: grid;
    grid-template-columns: 1fr 1.18fr;
    gap: 8px;
    margin-top: 8px;
}

.login-demo-widget {
    height: 105px;
    padding: 10px;
    overflow: hidden;
    border: 1px solid #e8eaf1;
    border-radius: 4px;
    background: #ffffff;
}

.login-demo-widget-title {
    margin-bottom: 8px;
    color: #20293d;
    font-size: 7px;
    font-weight: var(--font-weight-bold);
}

.login-demo-widget-title small {
    float: right;
    color: #9aa2b2;
    font-size: 5px;
    font-weight: var(--font-weight-semibold);
}

.login-demo-market {
    display: grid;
    grid-template-columns: 22px 64px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    margin: 6px 0;
    font-size: 6px;
}

.login-demo-market b {
    color: #30394e;
    font-size: 6px;
    white-space: nowrap;
}

.login-demo-market i {
    position: relative;
    height: 3px;
    overflow: hidden;
    border-radius: 4px;
    background: #edf0f6;
}

.login-demo-market i::after {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #775cf2, #9d8aff);
    content: "";
}

.login-demo-market:nth-of-type(2) i::after {
    width: 82%;
}

.login-demo-market:nth-of-type(3) i::after {
    width: 64%;
}

.login-demo-market:nth-of-type(4) i::after {
    width: 36%;
}

.login-demo-mp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    color: #ffffff;
    font-size: 6px;
    font-weight: var(--font-weight-bold);
}

.login-demo-mp--wb {
    background: #9f31c7;
}

.login-demo-mp--oz {
    background: #166ee8;
}

.login-demo-mp--ya {
    background: #f2bb19;
    color: #29230b;
}

.login-demo-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 7px;
    height: 76px;
    padding: 4px 5px 0;
    border-bottom: 1px solid #eef0f5;
}

.login-demo-bars i {
    flex: 1;
    min-width: 8px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(180deg, #8c75f7, #ddd7ff);
}

.login-demo-bars i:nth-child(1) { height: 34%; }
.login-demo-bars i:nth-child(2) { height: 48%; }
.login-demo-bars i:nth-child(3) { height: 41%; }
.login-demo-bars i:nth-child(4) { height: 62%; }
.login-demo-bars i:nth-child(5) { height: 56%; }
.login-demo-bars i:nth-child(6) { height: 88%; }
.login-demo-bars i:nth-child(7) { height: 72%; }

.login-demo-base {
    position: relative;
    z-index: 1;
    width: 108%;
    height: 13px;
    margin: -2px 0 0 -4%;
    border-radius: 2px 2px 4px 4px;
    background: linear-gradient(180deg, #d8dbe3, #b8becb 55%, #eef0f4);
    box-shadow: 0 8px 15px rgba(42, 49, 67, 0.12);
}

.login-demo-base::after {
    display: block;
    width: 80px;
    height: 4px;
    margin: 0 auto;
    border-radius: 0 0 4px 4px;
    background: #a9aebb;
    content: "";
}

.login-product-values {
    margin-top: 14px;
    color: #687388;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.02em;
}

/* Auth side */

.login-auth-panel {
    display: flex;
    align-items: center;
    min-width: 0;
    border-left: 1px solid #e7e9f1;
    background: #ffffff;
    box-shadow: -18px 0 42px rgba(28, 37, 57, 0.035);
}

.login-auth-panel-inner {
    width: min(100% - 52px, 440px);
    margin: 0 auto;
    padding: 44px 0 34px;
}

.login-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.login-heading {
    margin-bottom: 22px;
    text-align: left;
}

.login-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 0 0 24px;
    padding: 4px;
    border: 1px solid #e4e7ee;
    border-radius: 4px;
    background: #f4f5f9;
}

.login-method {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 4px;
    color: #727b8f;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1.25;
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.login-method:hover {
    background: rgba(255, 255, 255, 0.72);
    color: var(--color-primary);
}

.login-method--active {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(24, 32, 49, 0.08);
    color: var(--color-primary);
}

.login-password-field {
    margin-bottom: 10px;
}

.login-password-control {
    position: relative;
}

.login-password-input {
    padding-right: 48px;
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #687187;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background 0.16s ease, color 0.16s ease;
}

.login-password-toggle:hover,
.login-password-toggle:focus-visible {
    background: #f2f4f8;
    color: var(--color-primary);
}

.login-password-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-password-icon--hide,
.login-password-toggle.is-visible .login-password-icon--show {
    display: none;
}

.login-password-toggle.is-visible .login-password-icon--hide {
    display: block;
}

.login-magic-note {
    margin: 13px 2px 0;
    color: #5b6477;
    font-size: var(--font-size-base);
    line-height: 1.45;
    text-align: center;
}

.login-magic-sent {
    text-align: center;
}

.login-magic-sent-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 2px auto 14px;
    border-radius: 50%;
    background: var(--color-success-bg);
    color: #178555;
    font-size: 24px;
    font-weight: var(--font-weight-bold);
}

.login-magic-sent h2 {
    margin: 0 0 8px;
    color: #111b33;
    font-size: 30px;
    font-weight: var(--font-weight-bold);
}

.login-magic-sent p {
    margin: 0 auto;
    color: #4b556b;
    font-size: var(--font-size-base);
    line-height: 1.5;
}

.login-magic-sent p strong {
    color: #111b33;
    font-weight: var(--font-weight-semibold);
    overflow-wrap: anywhere;
}

.login-magic-sent .kenvara-auth-submit {
    margin-top: 20px;
}

.login-register-separator {
    position: relative;
    margin: 22px 0 18px;
    color: #8b95a7;
    font-size: 16px;
    text-align: center;
}

.login-register-separator::before {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 1px;
    background: #e8eaf0;
    content: "";
}

.login-register-separator span {
    position: relative;
    z-index: 1;
    padding: 0 12px;
    background: #ffffff;
}

.login-register-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    border: 1px solid #6952e8;
    border-radius: var(--radius-control);
    color: #5c46d9;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: background 0.16s ease, color 0.16s ease;
}

.login-register-button:hover {
    background: #f6f3ff;
    color: #513acb;
}

.login-register-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-trust-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 28px;
    color: #707b90;
    font-size: 16px;
    line-height: 1.25;
}

.login-trust-row span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-trust-row svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #68758e;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1280px) {
    .login-layout {
        grid-template-columns: minmax(0, 1fr) 430px;
    }

    .login-product {
        padding-inline: 42px;
    }

    .login-product-copy h2 {
        font-size: 34px;
    }

    .login-product-points {
        gap: 12px;
    }

    .login-product-demo {
        max-width: 700px;
    }

    .login-demo-screen {
        height: 240px;
    }
}

@media (max-width: 1020px) {
    .login-product-points {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-product-demo {
        margin-top: 22px;
    }

    .login-demo-screen {
        height: 230px;
    }
}

@media (max-width: 860px) {
    .login-layout {
        display: block;
        min-height: 100vh;
        background: #ffffff;
    }

    .login-product {
        display: block;
        padding: 24px 22px 14px;
        background:
            radial-gradient(circle at 12% 8%, rgba(91, 67, 214, 0.08), transparent 34%),
            #f6f8fc;
    }

    .login-product-inner {
        width: min(100%, 520px);
    }

    .login-product-logo {
        margin: 0;
    }

    .login-product-logo img {
        width: 220px;
    }

    .login-product-copy {
        display: none;
    }

    .login-auth-panel {
        display: block;
        border-left: 0;
        box-shadow: none;
    }

    .login-auth-panel-inner {
        width: min(100% - 44px, 480px);
        padding: 30px 0 38px;
    }
}

@media (max-width: 420px) {
    .login-product {
        padding-inline: 18px;
    }

    .login-product-logo img {
        width: 204px;
    }

    .login-auth-panel-inner {
        width: calc(100% - 36px);
    }

    .kenvara-auth-heading h1 {
        font-size: 28px;
    }

    .login-method {
        padding-inline: 8px;
    }
}
