/* ── Страница входа: панель + визуал ── */
.tp-login-shell {
    display: flex;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.tp-login-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    width: min(100%, 28rem);
    min-height: 0;
    height: 100%;
    border-right: 1px solid rgba(88, 28, 135, 0.35);
    background: linear-gradient(180deg, rgba(12, 8, 22, 0.98) 0%, rgba(8, 6, 14, 0.99) 100%);
    backdrop-filter: blur(12px);
}

.tp-login-panel-top {
    flex-shrink: 0;
    padding: 2rem 2.25rem 0;
    padding-top: max(1.25rem, env(safe-area-inset-top, 0px));
}

.tp-login-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
    padding: 1.5rem 2.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tp-login-panel-foot {
    flex-shrink: 0;
    padding: 0 2.25rem 2rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}

.tp-login-ecosystem {
    display: block;
    margin-bottom: 0.15rem;
    font-size: 10px;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(103, 232, 249, 0.75);
}

.tp-login-input {
    margin-top: 0.35rem;
    width: 100%;
    box-sizing: border-box;
    border-radius: 0.75rem;
    border: 1px solid rgba(88, 28, 135, 0.55);
    background: rgba(18, 10, 31, 0.85);
    padding: 0.65rem 0.85rem;
    font-size: 16px; /* предотвращает zoom на iOS */
    color: #f1f5f9;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tp-login-input:focus {
    border-color: rgba(34, 211, 238, 0.65);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.tp-login-hint {
    border-radius: 0.75rem;
    border: 1px solid rgba(34, 211, 238, 0.2);
    background: rgba(34, 211, 238, 0.08);
    padding: 0.65rem 0.75rem;
    font-size: 11px;
    line-height: 1.45;
    color: #a5f3fc;
}

.tp-login-visual {
    position: relative;
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse 70% 55% at 52% 42%, rgba(126, 34, 206, 0.22) 0%, transparent 62%),
        radial-gradient(ellipse 45% 40% at 48% 46%, rgba(8, 145, 178, 0.14) 0%, transparent 55%),
        linear-gradient(135deg, #07050f 0%, #0c0818 45%, #05040a 100%);
}

.tp-login-visual::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 55%;
    height: 40%;
    background: linear-gradient(145deg, transparent 20%, rgba(5, 4, 10, 0.55) 70%);
    pointer-events: none;
    z-index: 3;
}

.tp-login-visual-caption {
    position: absolute;
    right: 2.25rem;
    bottom: 2rem;
    left: auto;
    z-index: 5;
    max-width: min(26rem, calc(100% - 3rem));
    pointer-events: none;
    text-align: right;
    padding: 1rem 1.25rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(88, 28, 135, 0.4);
    background: rgba(5, 4, 10, 0.78);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.tp-login-visual-caption p:first-child {
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: #67e8f9;
    margin-bottom: 0.45rem;
}

.tp-login-visual-caption h2 {
    font-size: clamp(1.15rem, 2vw, 1.6rem);
    font-weight: 800;
    line-height: 1.3;
    color: #f1f5f9;
}

.tp-login-visual-caption p:last-child {
    margin-top: 0.55rem;
    font-size: 12px;
    line-height: 1.5;
    color: #94a3b8;
}

.tp-login-pulse-strip {
    position: absolute;
    left: 1.75rem;
    right: 2.25rem;
    z-index: 4;
    pointer-events: none;
    opacity: 0.92;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
}

.tp-login-pulse-canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}

.tp-login-scene {
    position: absolute;
    inset: 6% 4% 20% 4%;
}

.tp-login-swarm-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
}

.tp-login-swarm-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.tp-login-core {
    position: absolute;
    left: 50%;
    top: 46%;
    width: clamp(9.75rem, 19.5vw, 13.5rem);
    height: clamp(9.75rem, 19.5vw, 13.5rem);
    transform: translate(-50%, -50%);
    z-index: 4;
    animation: tp-login-breathe 2.8s ease-in-out infinite;
}

@keyframes tp-login-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

.tp-login-atom {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 480px;
    transform-style: preserve-3d;
}

.tp-login-atom-glow {
    position: absolute;
    inset: -30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.22) 0%, transparent 68%);
    animation: tp-login-atom-glow 2.8s ease-in-out infinite;
}

@keyframes tp-login-atom-glow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.06); }
}

.tp-login-nucleus {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 32%;
    height: 32%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 38% 32%, #ecfeff 0%, #22d3ee 40%, #7c3aed 100%);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.65), 0 0 55px rgba(124, 58, 237, 0.35);
    z-index: 3;
}

.tp-login-atom-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 92%;
    height: 36%;
    margin: -18% 0 0 -46%;
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 50%;
    transform-style: preserve-3d;
    pointer-events: none;
}

.tp-login-atom-orbit--1 {
    transform: rotateX(68deg);
    animation: tp-login-orbit-spin-1 7s linear infinite;
}

.tp-login-atom-orbit--2 {
    width: 78%;
    height: 30%;
    margin: -15% 0 0 -39%;
    border-color: rgba(167, 139, 250, 0.32);
    transform: rotateX(68deg) rotateY(58deg);
    animation: tp-login-orbit-spin-2 10s linear infinite reverse;
}

.tp-login-atom-orbit--3 {
    width: 100%;
    height: 40%;
    margin: -20% 0 0 -50%;
    border-color: rgba(103, 232, 249, 0.22);
    transform: rotateY(72deg);
    animation: tp-login-orbit-spin-3 13s linear infinite;
}

@keyframes tp-login-orbit-spin-1 { to { transform: rotateX(68deg) rotateZ(360deg); } }
@keyframes tp-login-orbit-spin-2 { to { transform: rotateX(68deg) rotateY(58deg) rotateZ(360deg); } }
@keyframes tp-login-orbit-spin-3 { to { transform: rotateY(72deg) rotateZ(360deg); } }

.tp-login-electron {
    position: absolute;
    top: 50%;
    left: 100%;
    width: 5px;
    height: 5px;
    margin: -2.5px 0 0 -2.5px;
    border-radius: 50%;
    background: #67e8f9;
    box-shadow: 0 0 8px rgba(103, 232, 249, 0.95);
}

.tp-login-atom-orbit--2 .tp-login-electron {
    background: #c4b5fd;
    box-shadow: 0 0 8px rgba(196, 181, 253, 0.9);
}

.tp-login-atom-orbit--3 .tp-login-electron {
    width: 4px;
    height: 4px;
    margin: -2px 0 0 -2px;
    background: #a5f3fc;
}

.tp-login-vortex-haze {
    position: absolute;
    left: 50%;
    top: 46%;
    width: 68%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
    z-index: 0;
    animation: tp-login-vortex-spin 90s linear infinite;
}

@keyframes tp-login-vortex-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .tp-login-swarm-canvas,
    .tp-login-core,
    .tp-login-atom-glow,
    .tp-login-atom-orbit,
    .tp-login-vortex-haze,
    .tp-login-pulse-strip {
        animation: none !important;
    }
    .tp-login-swarm-canvas { opacity: 0.35 !important; }
    .tp-login-pulse-strip { opacity: 0.4 !important; }
}

/* Планшет и телефон */
@media (max-width: 768px) {
    .tp-login-shell {
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    .tp-login-panel {
        width: 100%;
        flex: 0 0 auto;
        max-height: none;
        height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(88, 28, 135, 0.35);
    }

    .tp-login-panel-top {
        padding: max(0.85rem, env(safe-area-inset-top, 0px)) 1.25rem 0;
    }

    .tp-login-panel-body {
        padding: 0.5rem 1.25rem 1.25rem;
        justify-content: flex-start;
        flex: 0 0 auto;
    }

    .tp-login-visual {
        flex: 1 1 0;
        min-height: 0;
        max-height: none;
    }

    .tp-login-visual-caption {
        left: 1rem;
        right: 1rem;
        bottom: max(1rem, env(safe-area-inset-bottom, 0px));
        max-width: none;
        text-align: left;
        padding: 0.75rem 1rem;
    }

    .tp-login-pulse-strip {
        left: 1rem;
        right: 1rem;
    }

    .tp-login-scene {
        inset: 8% 4% 36% 4%;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    .tp-login-panel-top {
        padding-top: max(0.75rem, env(safe-area-inset-top));
    }

    .tp-login-panel-body h1 {
        font-size: 1.35rem;
    }

    .tp-login-visual-caption h2 {
        font-size: 1rem;
    }

    .tp-login-visual-caption p:last-child {
        font-size: 11px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .tp-login-core {
        width: clamp(7rem, 42vw, 10rem);
        height: clamp(7rem, 42vw, 10rem);
    }
}

/* Ландшафт на телефоне */
@media (max-width: 896px) and (max-height: 500px) and (orientation: landscape) {
    .tp-login-shell {
        flex-direction: row;
    }

    .tp-login-panel {
        width: min(52%, 22rem);
        height: 100dvh;
        border-right: 1px solid rgba(88, 28, 135, 0.35);
        border-bottom: none;
        overflow-y: auto;
    }

    .tp-login-panel-body {
        padding: 0.35rem 1rem 0.75rem;
    }

    .tp-login-panel-foot {
        display: none;
    }

    .tp-login-visual {
        flex: 1 1 0;
        min-height: 0;
    }

    .tp-login-visual-caption {
        display: none;
    }
}
