@import url('../tokens/themes.css?v=25');
@import url('../tokens/variables.css?v=25');
@import url('../base/reset.css?v=25');
@import url('../base/typography.css?v=25');
@import url('../components/inputs.css?v=25');

body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 24px;
    padding-top: max(24px, var(--sa-top));
    padding-bottom: max(24px, var(--sa-bottom));
    overflow: hidden;
}

.card {
    position: relative;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 34px 30px 24px;
    border-radius: 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    animation: card-in 0.5s var(--ease-out) both;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(10, 132, 255, 0.12);
    color: var(--accent);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.brand-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1;
}

.brand-name .c {
    color: var(--accent);
}

.brand-name .d {
    color: var(--text);
}

.auth-head {
    margin-top: 2px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 6px;
}

.auth-sub {
    font-size: 14px;
    color: var(--dim);
    line-height: 1.45;
}

.tabs {
    position: relative;
    display: flex;
    padding: 4px;
    background: var(--panel-2);
    border-radius: 12px;
}

.tabs::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    border-radius: 9px;
    background: var(--panel);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s var(--ease-spring);
    z-index: 1;
}

.tabs.is-register::before {
    transform: translateX(100%);
}

.tab {
    flex: 1;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--dim);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.011em;
    position: relative;
    z-index: 2;
    transition: color 0.25s var(--ease-out);
}

.tab.active {
    color: var(--text);
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.field input.input {
    padding-right: 52px;
}

.field .pw-toggle {
    position: absolute;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--mute);
    display: grid;
    place-items: center;
    transition: color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}

.pw-toggle:hover {
    color: var(--text);
    background: var(--hover);
}

.pw-toggle.visible {
    color: var(--accent);
}

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

.msg {
    font-size: 13px;
    text-align: center;
    min-height: 18px;
    line-height: 1.4;
    padding: 0 4px;
    transition: color 0.2s var(--ease-out);
}

.msg.error {
    color: var(--red);
}

.msg.success {
    color: var(--green);
}

.msg.info {
    color: var(--warning);
}

.msg:empty {
    min-height: 0;
}

.btn-submit {
    width: 100%;
    padding: 14px 16px;
    border-radius: 13px;
    background: var(--accent);
    color: #fff;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: -0.012em;
    margin-top: 4px;
    box-shadow: 0 8px 24px -8px rgba(10, 132, 255, 0.5);
    transition: filter 0.15s var(--ease-out),
                transform 0.1s var(--ease-out),
                background 0.2s var(--ease-out),
                color 0.2s var(--ease-out),
                box-shadow 0.2s var(--ease-out);
}

.btn-submit:hover:not(:disabled) {
    filter: brightness(1.06);
}

.btn-submit:active:not(:disabled) {
    transform: scale(0.985);
}

.btn-submit:disabled {
    background: var(--panel-2);
    color: var(--mute);
    box-shadow: none;
    cursor: not-allowed;
    opacity: 1;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 2px 0;
    color: var(--mute);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-vk {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 13px;
    background: var(--vk);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.012em;
    transition: filter 0.15s var(--ease-out), transform 0.1s var(--ease-out);
    box-shadow: 0 8px 24px -8px rgba(0, 119, 255, 0.55);
}

.btn-vk:hover {
    filter: brightness(1.08);
}

.btn-vk:active {
    transform: scale(0.985);
}

.btn-vk svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #fff;
}

.foot {
    text-align: center;
    font-size: 12px;
    color: var(--mute);
    line-height: 1.55;
    margin-top: 4px;
}

.foot a {
    color: var(--dim);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s var(--ease-out);
    cursor: pointer;
}

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

@media (max-width: 440px) {
    body.login-page {
        padding: 16px;
        padding-top: max(16px, var(--sa-top));
        padding-bottom: max(16px, var(--sa-bottom));
        align-items: flex-start;
    }
    .card {
        padding: 28px 22px 20px;
        border-radius: 20px;
        gap: 18px;
        margin-top: max(12px, calc(var(--sa-top) + 8px));
    }
    .brand-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }
    .brand-icon svg {
        width: 22px;
        height: 22px;
    }
    .brand-name {
        font-size: 19px;
    }
    .auth-title {
        font-size: 20px;
    }
    .auth-sub {
        font-size: 13.5px;
    }
    .field-icon {
        left: 13px;
        width: 17px;
        height: 17px;
    }
    .btn-submit,
    .btn-vk {
        padding: 14px 16px;
        font-size: 15px;
    }
}