* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    color: #fff7e6;
    background:
        linear-gradient(120deg, rgba(255, 179, 26, 0.08) 0 25%, transparent 25% 100%),
        radial-gradient(circle at 18% 14%, rgba(242, 27, 45, 0.24), transparent 25rem),
        radial-gradient(circle at 84% 10%, rgba(255, 179, 26, 0.18), transparent 24rem),
        radial-gradient(circle at 50% 90%, rgba(45, 90, 14, 0.22), transparent 28rem),
        linear-gradient(135deg, #17100d 0%, #2a1712 45%, #100c0b 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(242, 27, 45, 0.26), inset 0 1px 0 rgba(255, 250, 240, 0.86);
    }

    50% {
        box-shadow: 0 36px 100px rgba(255, 179, 26, 0.3), inset 0 1px 0 rgba(255, 250, 240, 0.86);
    }
}

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

.shell {
    width: min(1080px, 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: #b99a76;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brand-mark {
    display: block;
    width: min(330px, 82vw);
    height: auto;
    margin: 0 0 -24px;
    filter: drop-shadow(0 28px 50px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 28px rgba(242, 27, 45, 0.28));
}

h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(2.55rem, 5vw, 5.35rem);
    line-height: 0.95;
    letter-spacing: 0;
    color: #fff8df;
    text-shadow: 0 10px 32px rgba(0, 0, 0, 0.42);
}

.intro {
    max-width: 620px;
    margin: 18px 0 0;
    color: #f4dcb5;
    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(255, 179, 26, 0.22);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 179, 26, 0.14), rgba(242, 27, 45, 0.08)),
        rgba(18, 10, 8, 0.52);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 248, 223, 0.16);
    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: #d5b58b;
    font-size: 0.88rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.14);
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(2, 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(255, 179, 26, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 249, 231, 0.97), rgba(252, 230, 190, 0.88)),
        rgba(255, 247, 230, 0.9);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 250, 240, 0.88);
    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), var(--accent-2));
    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(154, 63, 16, 0.18);
    border-radius: 999px;
    color: #8a4b20;
    background: rgba(255, 246, 225, 0.9);
    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.94);
}

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

.system-icon {
    display: grid;
    width: 86px;
    height: 86px;
    margin: 36px 0 44px;
    place-items: center;
    border-radius: 8px;
    color: #fff8df;
    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-icon.has-logo {
    background: #fff8df;
    box-shadow: 0 22px 48px rgba(34, 197, 94, 0.18);
}

.system-icon img {
    display: block;
    width: 76px;
    height: 76px;
    object-fit: contain;
}

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

.system-description {
    margin-top: 12px;
    color: #6e4b35;
    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: #7a5a3f;
}

.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;
}

.swal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    backdrop-filter: blur(5px);
    transition: opacity 180ms ease;
}

.swal-overlay.is-visible {
    opacity: 1;
}

.swal-overlay.is-closing {
    opacity: 0;
}

.swal-modal {
    width: min(100%, 390px);
    padding: 34px 30px 28px;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 28px 90px rgba(2, 6, 23, 0.34);
    text-align: center;
    transform: translateY(14px) scale(0.96);
    transition: transform 180ms ease;
}

.swal-overlay.is-visible .swal-modal {
    transform: translateY(0) scale(1);
}

.swal-icon {
    display: inline-flex;
    width: 74px;
    height: 74px;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 50%;
    font-size: 42px;
    font-weight: 800;
}

.swal-success {
    border: 3px solid rgba(34, 197, 94, 0.18);
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.swal-error {
    border: 3px solid rgba(239, 68, 68, 0.16);
    background: #fff1f1;
    color: #b91c1c;
}

.swal-modal h3 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 24px;
}

.swal-modal p {
    margin: 0;
    color: #64748b;
    line-height: 1.55;
}

.swal-button {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    border: 0;
    border-radius: 8px;
    background: #f21b2d;
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.swal-button:hover,
.swal-button:focus {
    background: #c91524;
    transform: translateY(-1px);
}

@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;
    }
}
