* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: #e8eef7;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.06) 0 24%, transparent 24% 100%),
        radial-gradient(circle at 12% 10%, rgba(34, 197, 94, 0.18), transparent 24rem),
        radial-gradient(circle at 88% 16%, rgba(14, 165, 233, 0.14), transparent 23rem),
        linear-gradient(135deg, #202b3a 0%, #273446 48%, #182231 100%);
}

@keyframes pageReveal {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes panelReveal {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes activeBreath {
    0%,
    100% {
        box-shadow: 0 32px 92px rgba(85, 115, 242, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    }

    50% {
        box-shadow: 0 36px 100px rgba(123, 91, 214, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    }
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    width: min(1200px, calc(100% - 40px));
    margin: 0 auto;
    padding: 72px 0;
}

.hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 38px;
}

.hero > div:first-child {
    animation: pageReveal 620ms ease both;
}

.eyebrow,
.card-topline {
    margin: 0 0 10px;
    color: #b8c2d1;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    width: 106px;
    height: 106px;
    margin-bottom: 28px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    color: #f8fafc;
    background: #111827;
    box-shadow: 0 22px 50px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0;
}

h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(2.55rem, 5vw, 5.35rem);
    line-height: 0.95;
    letter-spacing: 0;
    color: #f8fafc;
}

.intro {
    max-width: 620px;
    margin: 18px 0 0;
    color: #c2ccda;
    font-size: 1.04rem;
    line-height: 1.65;
}

.hero-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 250px;
    padding: 19px 21px;
    border: 1px solid rgba(226, 232, 240, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07)),
        rgba(15, 23, 42, 0.28);
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(20px);
    animation: panelReveal 680ms ease 120ms both;
}

.hero-panel strong,
.hero-panel span {
    display: block;
}

.hero-panel strong {
    font-size: 0.98rem;
}

.hero-panel span:not(.status-dot) {
    margin-top: 3px;
    color: #b8c2d1;
    font-size: 0.88rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #16a34a;
    box-shadow: 0 0 0 7px rgba(22, 163, 74, 0.12);
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.system-card {
    position: relative;
    display: flex;
    min-height: 368px;
    flex-direction: column;
    overflow: hidden;
    padding: 26px;
    border: 1px solid rgba(226, 232, 240, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.86)),
        rgba(255, 255, 255, 0.9);
    box-shadow: 0 28px 80px rgba(2, 6, 23, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    animation: pageReveal 560ms ease both;
    animation-delay: calc(180ms + var(--delay, 0ms));
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.system-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 34%, white));
    content: "";
}

.system-card.is-active {
    border-color: color-mix(in srgb, var(--accent) 34%, transparent);
    box-shadow: 0 32px 92px color-mix(in srgb, var(--accent) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    animation-name: pageReveal, activeBreath;
    animation-duration: 560ms, 2600ms;
    animation-delay: calc(180ms + var(--delay, 0ms)), 1100ms;
    animation-fill-mode: both, none;
    animation-iteration-count: 1, infinite;
    animation-timing-function: ease, ease-in-out;
}

.system-card.is-active:hover,
.system-card.is-active:focus-visible {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--accent) 58%, white);
    box-shadow: 0 42px 110px color-mix(in srgb, var(--accent-2) 36%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.92);
    outline: 0;
}

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

.system-card.is-offline {
    opacity: 0.76;
}

.system-card.is-offline::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.34), rgba(255, 255, 255, 0.08));
    content: "";
    pointer-events: none;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid rgba(100, 116, 139, 0.18);
    border-radius: 999px;
    color: #64748b;
    background: rgba(248, 250, 252, 0.86);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.status-pill::before {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #94a3b8;
    content: "";
}

.is-active .status-pill {
    border-color: rgba(34, 197, 94, 0.24);
    color: #15803d;
    background: rgba(220, 252, 231, 0.9);
}

.is-active .status-pill::before {
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.system-icon {
    display: grid;
    width: 72px;
    height: 72px;
    margin: 36px 0 44px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background:
        linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 22px 48px color-mix(in srgb, var(--accent) 28%, transparent);
    font-weight: 800;
    letter-spacing: 0.03em;
}

.system-name {
    color: #111827;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.25;
    text-transform: uppercase;
}

.system-description {
    margin-top: 12px;
    color: #667085;
    font-size: 0.94rem;
    line-height: 1.55;
}

.open-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 28px;
    color: var(--accent);
    font-weight: 800;
}

.is-offline .open-link {
    color: #64748b;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(440px, 100%);
    padding: 34px;
    border: 1px solid rgba(113, 128, 150, 0.22);
    border-top: 6px solid var(--accent);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #172033;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.14);
}

.login-card h1 {
    font-size: 2.1rem;
    line-height: 1.05;
}

.back-link {
    display: inline-flex;
    margin-bottom: 28px;
    color: #526174;
    font-size: 0.92rem;
    font-weight: 700;
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 700;
}

.login-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #172033;
    font: inherit;
}

.login-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
    outline: 0;
}

.login-form button {
    height: 50px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--accent);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

@media (max-width: 980px) {
    .hero {
        align-items: start;
        flex-direction: column;
    }

    .system-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .shell {
        width: min(100% - 28px, 1180px);
        padding: 34px 0;
    }

    h1 {
        font-size: 2.35rem;
    }

    .hero-panel {
        width: 100%;
    }

    .system-grid {
        grid-template-columns: 1fr;
    }

    .system-card {
        min-height: 260px;
    }

    .login-card {
        padding: 26px;
    }
}
