:root {
    --bg-deep: #071120;
    --bg-mid: #0d1c33;
    --bg-soft: #153562;
    --card-stroke: rgba(69, 127, 218, 0.24);
    --text-main: #173056;
    --text-muted: #6f819d;
    --text-light: rgba(236, 244, 255, 0.82);
    --line-soft: rgba(23, 48, 86, 0.12);
    --accent-blue: #2563eb;
    --accent-cyan: #38bdf8;
    --accent-green: #1fb76c;
    --accent-green-deep: #10955a;
    --accent-indigo: #405cf5;
    --accent-indigo-deep: #2747d9;
    --shadow-main: 0 30px 70px rgba(7, 17, 32, 0.28);
    --shadow-soft: 0 14px 28px rgba(37, 99, 235, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text-main);
    font-family: "Segoe UI Variable Text", "Segoe UI", "Trebuchet MS", sans-serif;
    background: linear-gradient(90deg, #081426 0%, #10284a 50%, #2d8b97 50%, #2c808c 100%);
    overflow-x: hidden;
}

.page-brand {
    position: fixed;
    top: 22px;
    left: 26px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 10px;
    border-radius: 999px;
    border: 1px solid rgba(116, 181, 255, 0.18);
    background: rgba(7, 17, 32, 0.26);
    color: #dff1ff;
    text-decoration: none;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 26px rgba(4, 10, 20, 0.16);
}

.page-brand__logo {
    width: 68px;
    height: 68px;
    display: block;
    object-fit: contain;
}

.page-brand__text {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.page-stars,
.page-matrix-columns,
.page-matrix-tags {
    position: fixed;
    inset: 0 auto 0 0;
    width: 50vw;
    pointer-events: none;
}

.page-stars {
    background-image:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.88) 0 1.1px, transparent 1.2px),
        radial-gradient(circle at 30% 34%, rgba(120, 219, 255, 0.82) 0 1.3px, transparent 1.4px),
        radial-gradient(circle at 64% 22%, rgba(255, 255, 255, 0.92) 0 1px, transparent 1.1px),
        radial-gradient(circle at 82% 16%, rgba(104, 220, 255, 0.78) 0 1.2px, transparent 1.3px),
        radial-gradient(circle at 74% 71%, rgba(255, 255, 255, 0.84) 0 1px, transparent 1.1px),
        radial-gradient(circle at 18% 76%, rgba(255, 255, 255, 0.76) 0 1px, transparent 1.1px),
        radial-gradient(circle at 51% 89%, rgba(120, 219, 255, 0.68) 0 1px, transparent 1.1px);
    animation: starShift 22s linear infinite alternate;
    opacity: 0.9;
}

.page-matrix-columns {
    overflow: hidden;
    mask-image: radial-gradient(circle at center, black 20%, black 72%, transparent 100%);
}

.page-matrix-columns::before,
.page-matrix-columns::after {
    content: "";
    position: absolute;
    inset: -10% 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 64px,
            rgba(50, 139, 255, 0.085) 64px,
            rgba(50, 139, 255, 0.085) 65px,
            transparent 65px,
            transparent 128px
        );
    animation: driftDown 18s linear infinite;
}

.page-matrix-columns::after {
    opacity: 0.38;
    filter: blur(2px);
    animation-duration: 26s;
    animation-direction: reverse;
}

.demo-shell {
    position: relative;
    min-height: 100vh;
    width: 100%;
}

.ambient,
.ambient-grid {
    position: fixed;
    inset: 0 auto 0 0;
    width: 50vw;
    pointer-events: none;
}

.ambient-one,
.ambient-two {
    width: 26rem;
    height: 26rem;
    border-radius: 50%;
    filter: blur(12px);
    opacity: 0.65;
    animation: floatOrb 14s ease-in-out infinite;
}

.ambient-one {
    top: -8rem;
    left: -6rem;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.5), rgba(56, 189, 248, 0));
}

.ambient-two {
    right: -7rem;
    bottom: -9rem;
    background: radial-gradient(circle, rgba(64, 92, 245, 0.45), rgba(64, 92, 245, 0));
    animation-delay: -5s;
}

.ambient-grid {
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(circle at center, black 18%, transparent 74%);
    opacity: 0.24;
}

.experience-layout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    align-items: stretch;
    gap: 0;
    padding-right: 0;
}

.visual-panel {
    position: relative;
    min-height: 100vh;
    animation: enterLeft 720ms ease-out both;
}

.visual-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 420px;
    height: 420px;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.login-side {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 48px 28px;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.18), transparent 24%),
        radial-gradient(circle at 82% 80%, rgba(145, 236, 244, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(120, 226, 233, 0.16), rgba(30, 98, 108, 0.04)),
        linear-gradient(180deg, #43aab4 0%, #3799a4 42%, #2f8d97 100%);
    overflow: hidden;
}

.login-side::before {
    content: "";
    position: absolute;
    inset: 28px;
    border-radius: 24px 0 0 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    opacity: 0.75;
}

.login-side::after {
    content: "";
    position: absolute;
    width: 34rem;
    height: 34rem;
    right: -8rem;
    bottom: -10rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107, 216, 225, 0.24), rgba(107, 216, 225, 0));
    filter: blur(12px);
    animation: floatPanelGlow 12s ease-in-out infinite;
    opacity: 0.95;
}

.login-side__inner {
    position: relative;
    z-index: 1;
    width: min(100%, 980px);
    display: grid;
    place-items: center;
}

.matrix-ring {
    position: absolute;
    inset: 50% auto auto 50%;
    border-radius: 50%;
    border: 1px solid rgba(93, 174, 255, 0.14);
    transform: translate(-50%, -50%);
    animation: spinRing 24s linear infinite;
}

.matrix-ring--one {
    width: 220px;
    height: 220px;
}

.matrix-ring--two {
    width: 320px;
    height: 320px;
    animation-duration: 34s;
    animation-direction: reverse;
}

.matrix-ring--three {
    width: 440px;
    height: 440px;
    animation-duration: 42s;
}

.matrix-tag {
    position: absolute;
    left: var(--start-x);
    top: var(--start-y);
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(132, 187, 255, 0.16);
    background: rgba(6, 16, 32, 0.34);
    color: rgba(222, 238, 255, 0.86);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    box-shadow: 0 12px 24px rgba(6, 16, 32, 0.14);
    backdrop-filter: blur(12px);
    pointer-events: none;
    transform:
        translate(-50%, -50%)
        scale(var(--tag-scale));
    animation:
        orbitShift var(--duration) linear infinite,
        tagPulse calc(var(--duration) * 0.45) ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: var(--tag-opacity);
}

.matrix-tag.is-strong {
    color: #f4f8ff;
    border-color: rgba(103, 180, 255, 0.28);
    background: linear-gradient(135deg, rgba(31, 112, 214, 0.2), rgba(56, 189, 248, 0.16));
}

.login-card {
    position: relative;
    width: min(100%, 722px);
    justify-self: center;
    margin-right: 0;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.985);
    border: 1px solid rgba(133, 162, 197, 0.16);
    box-shadow: 0 28px 60px rgba(7, 17, 32, 0.16);
    overflow: hidden;
    transition: box-shadow 220ms ease, border-color 220ms ease;
    isolation: isolate;
    animation: enterRight 760ms ease-out both;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        rgba(82, 168, 215, 0.08),
        rgba(79, 222, 210, 0.34),
        rgba(91, 123, 215, 0.16),
        rgba(82, 168, 215, 0.08)
    );
    animation: spinBorder 5.5s linear infinite;
    z-index: 0;
}

.login-card::after {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: calc(20px - 1px);
    background: rgba(255, 255, 255, 0.985);
    z-index: 0;
}

.login-card:hover {
    border-color: rgba(82, 126, 177, 0.22);
    box-shadow: 0 32px 68px rgba(7, 17, 32, 0.18);
}

.card-edge {
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, rgba(103, 152, 201, 0.55), rgba(63, 111, 170, 0.92), rgba(103, 152, 201, 0.55));
    z-index: 1;
}

.card-glow {
    display: none;
}

.login-card__inner {
    position: relative;
    z-index: 2;
    padding: 40px 32px 34px;
}

.login-card__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.login-card__logo {
    width: 124px;
    height: 124px;
    object-fit: contain;
    display: block;
}

.login-badge {
    display: block;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: #3f5f84;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    text-align: center;
    line-height: 1.25;
    max-width: 680px;
}

.error,
.success {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.82rem;
    line-height: 1.45;
    border: 1px solid transparent;
}

.error {
    background: rgba(255, 238, 238, 0.96);
    color: #b42318;
    border-color: rgba(232, 68, 84, 0.18);
}

.success {
    background: rgba(237, 252, 242, 0.96);
    color: #137a43;
    border-color: rgba(39, 174, 96, 0.18);
}

.brand {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
    animation: enterUp 720ms ease-out both;
}

.brand-ring {
    position: relative;
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.18), transparent 52%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(225, 238, 255, 0.9));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        0 16px 32px rgba(37, 99, 235, 0.14);
}

.brand-ring::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.brand-logo {
    width: 62px;
    height: auto;
    display: block;
    filter: drop-shadow(0 10px 18px rgba(37, 99, 235, 0.16));
}

.title {
    margin: 0 0 10px;
    text-align: center;
    font-family: "Bahnschrift SemiBold", "Franklin Gothic Medium", "Arial Narrow", sans-serif;
    font-size: clamp(1.12rem, 2.6vw, 1.42rem);
    line-height: 1.12;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    animation: enterUp 820ms ease-out both;
}

.subtitle {
    margin: 0 0 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    animation: enterUp 900ms ease-out both;
}

.action-form,
.telegram-form {
    margin: 0;
}

.form-group {
    margin-bottom: 18px;
}

.phone-field,
.telegram-form input[type="text"] {
    width: 100%;
    min-height: 54px;
    border-radius: 10px;
    border: 1px solid #d8e1ea;
    background: #ffffff;
    box-shadow: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.phone-field {
    display: grid;
    grid-template-columns: auto 1fr;
    overflow: hidden;
}

.phone-prefix {
    display: grid;
    place-items: center;
    padding: 0 12px;
    background: #f7fafc;
    color: #35516f;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-right: 1px solid #d8e1ea;
}

.telegram-form input[type="text"] {
    padding: 0 14px;
    font-size: 0.94rem;
    color: #35516f;
    outline: none;
}

.phone-field input {
    min-width: 0;
    border: 0;
    border-radius: 0 !important;
    background: transparent;
    box-shadow: none;
}

.phone-field:focus-within,
.telegram-form input[type="text"]:focus {
    border-color: #97b4d1;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 142, 193, 0.12);
}

.telegram-form input::placeholder {
    color: #99a6ba;
}

.helper-text {
    margin: 7px 2px 0;
    color: #76889d;
    font-size: 0.7rem;
    line-height: 1.45;
}

.helper-text a {
    color: #436ea3;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid rgba(64, 92, 245, 0.25);
}

.helper-text a:hover {
    color: #2b578d;
}

.divider {
    position: relative;
    margin: 24px 0 18px;
    text-align: center;
    color: #8a9ab0;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.divider::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    border-top: 1px solid #e4eaf1;
}

.divider span {
    position: relative;
    display: inline-block;
    padding: 0 8px;
    background: #ffffff;
}

.action-button {
    position: relative;
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0;
    cursor: pointer;
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.action-button span {
    position: relative;
    z-index: 1;
}

.action-button::before {
    display: none;
}

.action-button:hover {
    transform: translateY(-1px);
}

.action-button:active {
    transform: translateY(0);
}

.action-button--hemis {
    background: linear-gradient(180deg, #2b8d98, #237a84);
    box-shadow: 0 8px 18px rgba(43, 141, 152, 0.18);
}

.action-button--telegram {
    background: linear-gradient(180deg, #4b79da, #3d68c4);
    box-shadow: 0 8px 18px rgba(61, 104, 196, 0.16);
}

.footer-info {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e6edf3;
    text-align: center;
    color: #92a0b0;
    font-size: 0.68rem;
    line-height: 1.7;
}

.footer-info p {
    margin: 0;
}

.footer-info p + p {
    margin-top: 2px;
}

.is-demo-submitted .action-button--telegram {
    animation: submittedPulse 700ms ease;
}

.is-demo-submitted .action-button--hemis {
    animation: submittedPulse 700ms ease;
}

@keyframes floatOrb {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, 22px, 0) scale(1.05);
    }
}

@keyframes starShift {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(-8px, 10px, 0);
    }
}

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

@keyframes spinRing {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes enterLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes enterRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes floatPanelGlow {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(-20px, -14px, 0) scale(1.06);
    }
}

@keyframes driftDown {
    from {
        transform: translateY(-4%);
    }
    to {
        transform: translateY(4%);
    }
}

@keyframes spinBorder {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes orbitShift {
    0% {
        transform:
            translate(-50%, -50%)
            scale(var(--tag-scale));
    }
    25% {
        transform:
            translate(-50%, -50%)
            translate3d(calc(var(--drift-x) * 0.6), calc(var(--drift-y) * -0.55), 0)
            scale(calc(var(--tag-scale) + 0.04));
    }
    50% {
        transform:
            translate(-50%, -50%)
            translate3d(var(--drift-x), calc(var(--drift-y) * 0.25), 0)
            scale(var(--tag-scale));
    }
    75% {
        transform:
            translate(-50%, -50%)
            translate3d(calc(var(--drift-x) * -0.4), var(--drift-y), 0)
            scale(calc(var(--tag-scale) - 0.03));
    }
    100% {
        transform:
            translate(-50%, -50%)
            scale(var(--tag-scale));
    }
}

@keyframes tagPulse {
    0%,
    100% {
        opacity: var(--tag-opacity);
        box-shadow: 0 12px 24px rgba(6, 16, 32, 0.14);
    }
    50% {
        opacity: calc(var(--tag-opacity) + 0.18);
        box-shadow: 0 18px 30px rgba(6, 16, 32, 0.22);
    }
}

@keyframes submittedPulse {
    0% {
        box-shadow: 0 16px 28px rgba(64, 92, 245, 0.24);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(64, 92, 245, 0.12), 0 22px 36px rgba(64, 92, 245, 0.34);
    }
    100% {
        box-shadow: 0 16px 28px rgba(64, 92, 245, 0.24);
    }
}

@media (max-width: 540px) {
    .page-brand {
        top: 14px;
        left: 14px;
        padding: 8px 12px 8px 8px;
    }

    .page-brand__logo {
        width: 56px;
        height: 56px;
    }

    .page-brand__text {
        font-size: 0.94rem;
    }

    .demo-shell {
        padding: 24px 12px;
    }

    .experience-layout {
        gap: 18px;
    }

    .login-card__inner {
        padding: 24px 18px 18px;
    }

    .login-card__brand {
        gap: 10px;
        margin-bottom: 16px;
    }

    .login-card__logo {
        width: 88px;
        height: 88px;
    }

    .login-badge {
        font-size: 0.92rem;
    }

    .brand-ring {
        width: 88px;
        height: 88px;
    }

    .brand-logo {
        width: 58px;
    }

    .title {
        font-size: 1.04rem;
    }

    .subtitle {
        font-size: 0.78rem;
        margin-bottom: 16px;
    }

    .action-button,
    .phone-field,
    .telegram-form input[type="text"] {
        min-height: 44px;
        border-radius: 12px;
    }
}

@media (max-width: 980px) {
    .page-stars,
    .page-matrix-columns,
    .page-matrix-tags,
    .ambient-grid {
        width: 100vw;
    }

    .experience-layout {
        grid-template-columns: 1fr;
        width: 100%;
        padding-right: 0;
    }

    .login-side {
        order: -1;
        min-height: auto;
        padding: 32px 16px 40px;
    }

    .login-side::before {
        inset: 12px;
        border-radius: 18px;
    }

    .login-card {
        justify-self: center;
        margin-right: 0;
        width: min(100%, 680px);
    }

    .visual-panel {
        min-height: 300px;
    }

    .visual-orbit {
        left: 50%;
        width: 320px;
        height: 320px;
    }

    .matrix-ring--one {
        width: 170px;
        height: 170px;
    }

    .matrix-ring--two {
        width: 250px;
        height: 250px;
    }

    .matrix-ring--three {
        width: 340px;
        height: 340px;
    }
}

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