:root {
    --bg: #0b1220;
    --bg-2: #0f1629;
    --card: #15223f;
    --text: #e9eefc;
    --muted: #b8c2df;
    --accent: #5da9ff;
    --accent-2: #8ad0ff;
    --cta: #1e90ff;
    --cta-hover: #1677d5;
    --good: #35d399;
    --warn: #ffd166;
    --brand: #1E3050;
    --radius: 18px;
    --border: rgba(255, 255, 255, .12);
    --shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* Light mode tweak */
@media (prefers-color-scheme: light) {
    :root {
        --bg: #f5f7fb;
        --bg-2: #eef2f9;
        --card: #FFFFFF44;
        --text: #0b1220;
        --muted: #46506b;
        --accent: #1e90ff;
        --accent-2: #5da9ff;
        --cta: #1e90ff;
        --cta-hover: #1677d5;
        --brand: #1E3050;
        --border: rgba(30, 48, 8, .12);
        --shadow: 0 10px 30px rgba(30, 48, 80, .15), inset 0 1px 0 rgba(255, 255, 255, .04);
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background-image: url('assets/errorPageBackground.png');
    background:
        radial-gradient(1200px 600px at 80% -200px, rgba(93, 169, 255, .12), transparent 60%),
        radial-gradient(1200px 600px at -200px 60%, rgba(30, 48, 80, .25), transparent 60%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    display: grid;
    background-size: cover;
    place-items: center;
    padding: 24px;
}

.wrap {
    width: min(980px, 100%);
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    overflow: clip;
    position: relative;
    backdrop-filter: blur(5px);
}

.header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand .img-logo {
    background-image: url('assets/logo_white.svg');
    background-size: contain;
    background-repeat: no-repeat;
    width: 160px;
    height: 28px;
}

.brand .title {
    font-weight: 700;
    letter-spacing: .2px;
    margin-left: 15px;
}

.badge {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(93,169,255,.15);
    border: 1px solid rgba(93,169,255,.25);
    color: var(--accent);
}

.lang-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.lang-toggle button {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--muted);
    padding: 8px 12px;
    font-weight: 600;
    cursor: pointer;
}

.lang-toggle button.active {
    background: var(--accent);
    color: #071120;
}

.content {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 24px;
    align-items: center;
}

@media (max-width: 860px) {
    body {
        padding: 8px;
    }

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

    .lang-toggle {
        width: 86px;
        margin-left: -32px;
    }
    .brand .img-logo {
        width: 35px;
        background-image: url('assets/logo_white_sm.svg');
    }

    .brand .title {
        margin-left: 0;
    }
}

@media ((prefers-color-scheme: light) and (max-width: 860px)) {
    .brand .img-logo {
        width: 35px;
        background-image: url('assets/logo_black_sm.svg') !important;
    }
}

.icon-wrap {
    display: grid;
    place-items: center;
    padding: 12px;
}

.icon-wrap svg {
    width: clamp(100px, 40vw, 170px);
    height: auto;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .25));
    animation: float 4.8s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(22px, 3.2vw, 32px);
}

p {
    margin: 0 0 10px;
    color: var(--muted);
    line-height: 1.55;
}

a {
    font-size: .85rem;
    text-decoration: none;
}

.status {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
}

.status.ok {
    border-color: rgba(53, 211, 153, .35);
    background: rgba(53, 211, 153, .08);
}

.status.warn {
    border-color: rgba(255, 209, 102, .35);
    background: rgba(255, 209, 102, .10);
}

.actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 700;
    cursor: pointer;
    font-size: .85rem;
    transition: transform .05s ease, box-shadow .2s ease, background .2s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--cta);
    color: #fff;
    box-shadow: 0 6px 18px rgba(30, 144, 255, .35);
}

.btn-primary:hover {
    background: var(--cta-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--accent-2);
    border: 1px dashed var(--border);
}

.footer-note {
    margin-top: 16px;
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}

.terminal {
    background: rgba(35, 56, 105, 1);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-top: 12px;
    max-height: 40vh;
    overflow: auto;
    font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    color: #FFF;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Hide both language blocks by default; JS will reveal the right one */
[data-lang] {
    display: none;
}

[data-lang].active {
    display: block;
}


/* Light mode tweak */
@media (prefers-color-scheme: light) {
    body {
        background: none;
        background-image: url('assets/errorPageBackground.png');
        background-size: cover;
    }

    .icon-wrap {
        opacity: .4;
    }

    .lang-toggle button.active {
        background: var(--accent);
        color: #FFF;
    }

    .btn-primary {
        box-shadow: 0 4px 20px rgba(30, 144, 255, .25);
    }

    .brand .img-logo {
        background-image: url('assets/logo_black.svg');
    }

    .terminal {
        background: rgba(21, 34, 63, 1);
    }
}
