/* Десктопная авторизация — современный стиль с анимациями */
:root {
    --auth-desk-bg: #f8f9fb;
    --auth-desk-blue: #2563eb;
    --auth-desk-blue-2: #2d68ff;
    --auth-desk-blue-hover: #1d4ed8;
    --auth-desk-text: #111827;
    --auth-desk-muted: #6b7280;
    --auth-desk-radius: 22px;
}

@keyframes authFadeUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes authFloatSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes authFloatSoftAlt {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes authBadgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(1.25); }
}

@keyframes authShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@media (min-width: 1024px) {
    .auth-page.auth-page--centered,
    .auth-page.auth-page--desktop-split {
        display: block;
        min-height: 100vh;
        padding: 0;
        margin: 0;
        overflow-x: hidden;
        background: var(--auth-desk-bg) !important;
        font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
        position: relative;
        isolation: isolate;
    }

    /* Фоновые блобы */
    .auth-page--centered::before,
    .auth-page--centered::after,
    .auth-page--desktop-split::before,
    .auth-page--desktop-split::after {
        content: '';
        position: fixed;
        border-radius: 50%;
        pointer-events: none;
        z-index: 0;
        filter: blur(80px);
    }

    .auth-page--desktop-split::before {
        width: 520px;
        height: 520px;
        top: -120px;
        left: -80px;
        background: rgba(37, 99, 235, 0.09);
        animation: authFloatSoft 12s ease-in-out infinite;
    }

    .auth-page--desktop-split::after {
        width: 440px;
        height: 440px;
        bottom: -100px;
        right: -60px;
        background: rgba(99, 102, 241, 0.07);
        animation: authFloatSoftAlt 14s ease-in-out infinite;
    }

    .auth-desktop-wrap {
        position: relative;
        z-index: 1;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    /* ── Шапка ── */
    .auth-desktop-header {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 24px;
        padding: 20px 56px;
        background: rgba(248, 249, 251, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-shrink: 0;
        animation: authFadeIn 0.5s ease forwards;
    }

    .auth-desktop-brand {
        justify-self: start;
        display: flex;
        align-items: center;
        gap: 12px;
        text-decoration: none;
        color: var(--auth-desk-text);
        transition: opacity 0.2s;
    }

    .auth-desktop-brand:hover {
        opacity: 0.85;
    }

    .auth-desktop-brand__icon {
        flex-shrink: 0;
        line-height: 0;
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    .auth-desktop-brand:hover .auth-desktop-brand__icon {
        transform: scale(1.06) rotate(-3deg);
    }

    .auth-desktop-brand__name {
        font-size: 17px;
        font-weight: 700;
        line-height: 1.25;
        color: var(--auth-desk-text);
    }

    .auth-desktop-brand__tagline {
        font-size: 12px;
        color: var(--auth-desk-muted);
        font-weight: 400;
        line-height: 1.3;
    }

    .auth-desktop-nav {
        justify-self: center;
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .auth-desktop-nav a {
        color: var(--auth-desk-muted);
        text-decoration: none;
        font-size: 14px;
        font-weight: 500;
        white-space: nowrap;
        position: relative;
        transition: color 0.2s;
    }

    .auth-desktop-nav a::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: -4px;
        width: 0;
        height: 2px;
        background: var(--auth-desk-blue);
        border-radius: 2px;
        transition: width 0.25s ease;
    }

    .auth-desktop-nav a:hover {
        color: var(--auth-desk-text);
    }

    .auth-desktop-nav a:hover::after {
        width: 100%;
    }

    .auth-desktop-header__actions {
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 14px;
    }

    .auth-desktop-header__link {
        color: var(--auth-desk-muted);
        font-size: 14px;
        font-weight: 500;
        padding: 8px 4px;
    }

    .auth-desktop-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 22px;
        border-radius: 11px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        border: none;
        cursor: pointer;
        white-space: nowrap;
        transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    }

    .auth-desktop-btn--primary {
        background: linear-gradient(135deg, var(--auth-desk-blue-2) 0%, var(--auth-desk-blue) 100%);
        color: #fff;
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.32);
    }

    .auth-desktop-btn--primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.38);
    }

    .auth-desktop-btn--primary:active {
        transform: translateY(0);
    }

    /* ── Центрированная авторизация ── */
    .auth-center-stage {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 32px 24px 56px;
    }

    .auth-center-wrap {
        display: grid;
        grid-template-columns: minmax(260px, 300px) minmax(380px, 440px);
        gap: 40px;
        align-items: start;
        max-width: 820px;
        width: 100%;
        margin: 0 auto;
    }

    .auth-partner-promo {
        padding: 28px 26px;
        border-radius: var(--auth-desk-radius);
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(229, 231, 235, 0.95);
        box-shadow: 0 8px 32px rgba(15, 23, 42, 0.06);
        animation: authFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.15s forwards;
    }

    .auth-partner-promo--mobile {
        display: none;
    }

    .auth-partner-promo__badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 5px 12px;
        border-radius: 999px;
        background: #eff6ff;
        color: var(--auth-desk-blue);
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 14px;
    }

    .auth-partner-promo__badge-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--auth-desk-blue);
        animation: authBadgePulse 2s ease-in-out infinite;
    }

    .auth-partner-promo__title {
        margin: 0 0 16px;
        font-size: 1.35rem;
        font-weight: 800;
        line-height: 1.2;
        color: var(--auth-desk-text);
    }

    .auth-partner-promo__list {
        margin: 0 0 22px;
        padding: 0;
        list-style: none;
        color: var(--auth-desk-muted);
        font-size: 14px;
        line-height: 1.5;
    }

    .auth-partner-promo__list li {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 12px;
        animation: authFadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        opacity: 1;
    }

    .auth-partner-promo__list li:nth-child(1) { animation-delay: 0.25s; }
    .auth-partner-promo__list li:nth-child(2) { animation-delay: 0.35s; }
    .auth-partner-promo__list li:nth-child(3) { animation-delay: 0.45s; }
    .auth-partner-promo__list li:nth-child(4) { animation-delay: 0.55s; }

    .auth-partner-promo__icon {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 11px;
        background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
        color: var(--auth-desk-blue);
        transition: transform 0.25s ease, box-shadow 0.25s ease;
    }

    .auth-partner-promo__list li:hover .auth-partner-promo__icon {
        transform: scale(1.08) translateY(-2px);
        box-shadow: 0 6px 16px rgba(37, 99, 235, 0.18);
    }

    .auth-partner-promo__btn {
        width: 100%;
        margin-bottom: 12px;
        gap: 10px;
        position: relative;
        overflow: hidden;
    }

    .auth-partner-promo__btn::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
        background-size: 200% 100%;
        animation: authShimmer 3s ease-in-out infinite;
        pointer-events: none;
    }

    .auth-partner-promo__more {
        display: block;
        text-align: center;
        font-size: 13px;
        color: var(--auth-desk-blue);
        text-decoration: none;
        font-weight: 600;
    }

    .auth-center-column .auth-shell {
        width: 100%;
        max-width: none;
        align-items: stretch;
        gap: 16px;
    }

    .auth-page--centered .auth-hero,
    .auth-page--desktop-split .auth-hero {
        display: none !important;
    }

    .auth-page--centered .auth-card,
    .auth-page--desktop-split .auth-card {
        position: relative;
        z-index: 10;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 34px 34px 28px;
        border-radius: var(--auth-desk-radius);
        border: 1px solid rgba(255, 255, 255, 0.9);
        background: #fff;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.03),
            0 8px 32px rgba(15, 23, 42, 0.08),
            0 24px 64px rgba(37, 99, 235, 0.06);
        animation: authFadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
        overflow: visible;
    }

    .auth-page--centered .auth-card-title,
    .auth-page--desktop-split .auth-card-title {
        margin: 0;
        font-size: 26px;
        font-weight: 700;
        text-align: left;
        color: var(--auth-desk-text);
        line-height: 1.25;
    }

    .auth-page--centered .auth-card-subtitle,
    .auth-page--desktop-split .auth-card-subtitle {
        margin: 8px 0 26px;
        text-align: left;
        color: var(--auth-desk-muted);
        font-size: 14px;
        line-height: 1.5;
    }

    .auth-page--centered .auth-form label,
    .auth-page--desktop-split .auth-form label {
        color: #374151;
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 6px;
    }

    .auth-page--centered .auth-input-wrap,
    .auth-page--desktop-split .auth-input-wrap {
        border-color: #e5e7eb;
        border-radius: 11px;
        margin-bottom: 16px;
        padding: 0 14px;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .auth-page--desktop-split .auth-input-wrap input {
        padding: 13px 2px;
        font-size: 14px;
    }

    .auth-page--desktop-split .auth-input-wrap:focus-within {
        border-color: var(--auth-desk-blue);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    }

    .auth-page--desktop-split .auth-row {
        margin-bottom: 20px;
    }

    .auth-page--desktop-split .auth-remember {
        font-size: 13px;
        color: var(--auth-desk-muted);
    }

    .auth-page--desktop-split .auth-link {
        color: var(--auth-desk-blue);
        font-size: 13px;
        font-weight: 500;
        transition: color 0.15s;
    }

    .auth-page--desktop-split .auth-link:hover {
        color: var(--auth-desk-blue-hover);
    }

    .auth-page--centered .auth-submit,
    .auth-page--desktop-split .auth-submit {
        background: linear-gradient(135deg, var(--auth-desk-blue-2) 0%, var(--auth-desk-blue) 100%);
        border: none;
        border-radius: 11px;
        min-height: 48px;
        font-weight: 600;
        font-size: 15px;
        box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
        transition: transform 0.2s, box-shadow 0.2s;
        position: relative;
        overflow: hidden;
    }

    .auth-page--desktop-split .auth-submit:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 28px rgba(37, 99, 235, 0.38);
    }

    .auth-page--desktop-split .auth-submit:active {
        transform: translateY(0);
    }

    .auth-page--desktop-split .auth-sep {
        margin: 24px 0 18px;
        font-size: 11px;
        color: #9ca3af;
        letter-spacing: 0.06em;
    }

    .auth-page--centered .auth-download-btn,
    .auth-page--desktop-split .auth-download-btn {
        border: 1px solid #dbeafe;
        border-radius: 13px;
        background: linear-gradient(135deg, #f8faff 0%, #f0f6ff 100%);
        padding: 13px 15px;
        box-shadow: none;
        transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
        position: relative;
        z-index: 1;
    }

    .auth-page--desktop-split .auth-download-btn:hover {
        transform: translateY(-2px);
        border-color: #93c5fd;
        box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
    }

    .auth-page--desktop-split .auth-download-btn__title {
        font-size: 14px;
        color: #1e40af;
    }

    .auth-page--desktop-split .auth-download-btn__hint {
        font-size: 12px;
    }

    .auth-page--centered .auth-app-mobile-group,
    .auth-page--desktop-split .auth-app-mobile-group {
        display: none !important;
    }

    .auth-center-apps {
        animation: authFadeUp 0.6s ease 0.25s forwards;
        opacity: 1;
    }

    .auth-center-apps__grid .auth-download-btn {
        animation: authFadeUp 0.55s ease forwards;
        opacity: 1;
    }

    .auth-center-apps__grid .auth-download-btn:nth-child(1) { animation-delay: 0.3s; }
    .auth-center-apps__grid .auth-download-btn:nth-child(2) { animation-delay: 0.4s; }
    .auth-center-apps__grid .auth-download-btn:nth-child(3) { animation-delay: 0.5s; }

    .auth-center-apps__grid .auth-download-btn__icon {
        transition: transform 0.25s ease;
    }

    .auth-center-apps__grid .auth-download-btn:hover .auth-download-btn__icon {
        transform: scale(1.12) rotate(-4deg);
    }

    .auth-partner-promo {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .auth-partner-promo:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 40px rgba(37, 99, 235, 0.1);
    }

    .auth-center-apps__label {
        margin: 0 0 10px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: #9ca3af;
        text-align: center;
    }

    .auth-center-apps__grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .auth-page--centered .auth-footer,
    .auth-page--desktop-split .auth-footer {
        margin-top: 18px;
        text-align: center;
        font-size: 14px;
        color: var(--auth-desk-muted);
        position: relative;
        z-index: 1;
    }

    .auth-page--desktop-split .auth-footer a {
        color: var(--auth-desk-blue);
        font-weight: 600;
        transition: color 0.15s;
    }

    .auth-page--desktop-split .auth-footer-small {
        margin-top: 8px;
        font-size: 13px;
    }

    .auth-page--desktop-split .auth-offer-notice {
        position: relative;
        z-index: 1;
        max-width: none;
        margin-top: 18px;
        text-align: center;
        font-size: 11px;
        line-height: 1.5;
        color: #9ca3af;
    }

    .auth-page--desktop-split .msg {
        border-radius: 11px;
        font-size: 14px;
        position: relative;
        z-index: 1;
    }

    /* Toast поверх всего на странице входа */
    .auth-page--centered .toast,
    .auth-page--desktop-split .toast {
        z-index: 99999;
    }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
    .auth-page--desktop-split::before,
    .auth-page--desktop-split::after,
    .auth-desktop-hero__badge-dot {
        animation: none !important;
    }

    .auth-desktop-hero__badge,
    .auth-desktop-hero__title,
    .auth-desktop-hero__text,
    .auth-desktop-features li,
    .auth-page--desktop-split .auth-card {
        animation: authFadeIn 0.3s ease forwards !important;
    }
}

@media (max-width: 1023px) {
    .auth-desktop-header,
    .auth-partner-promo:not(.auth-partner-promo--mobile) {
        display: none !important;
    }

    .auth-partner-promo--mobile {
        display: block;
        margin-top: 8px;
        padding: 22px 20px;
        border-radius: var(--auth-desk-radius, 22px);
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid #e5e7eb;
        box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    }

    .auth-partner-promo__text {
        margin: 0 0 16px;
        font-size: 14px;
        color: var(--auth-desk-muted, #6b7280);
        line-height: 1.5;
    }

    .auth-center-stage {
        padding: 0;
    }

    .auth-center-wrap {
        display: block;
        max-width: none;
    }

    .auth-center-apps {
        margin-top: 4px;
    }

    .auth-desktop-wrap {
        display: block;
    }
}

@media (min-width: 1024px) and (max-width: 1200px) {
    .auth-desktop-header {
        padding: 18px 32px;
    }

    .auth-center-wrap {
        grid-template-columns: 1fr;
        max-width: 440px;
        gap: 24px;
    }

    .auth-partner-promo:not(.auth-partner-promo--mobile) {
        order: 2;
    }

    .auth-desktop-nav {
        gap: 22px;
    }
}

@media (min-width: 1024px) and (max-width: 1080px) {
    .auth-desktop-nav {
        display: none;
    }

    .auth-desktop-header {
        grid-template-columns: 1fr auto;
    }

    .auth-desktop-header__actions {
        justify-self: end;
    }
}
