@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&family=Fira+Code:wght@500;700&display=swap');

/* ==========================================================================
   1. VARIABLES & SCHEME
   ========================================================================== */
:root {
    --navy-malam: #062A4A;
    --navy-lembut: #0E3D63;
    --garis-navy: #1B4C77;
    --biru-andra: #0B5FA8;
    --teal-denyut: #12B5A5;
    --langit: #EAF3FB;
    --mint: #E6F7F5;
    --abu-klinik: #5A6B7A;
    --putih: #FFFFFF;

    --bg-gradient: radial-gradient(circle at 50% 45%, #0a3a66 0%, #062A4A 50%, #041e36 100%);
    --card-bg: rgba(14, 61, 99, 0.78);
    --card-border: rgba(27, 76, 119, 0.45);
    --card-shadow: 0 12px 40px rgba(6, 42, 74, 0.55);
    --text-primary: var(--putih);
    --text-secondary: #b8c9d9;
    --text-muted: var(--abu-klinik);
    --accent: var(--teal-denyut);
    --accent-glow: rgba(18, 181, 165, 0.35);
    --btn-other-bg: rgba(255, 255, 255, 0.06);
}

body.light-mode {
    --bg-gradient: linear-gradient(135deg, #EAF3FB 0%, #E6F7F5 50%, #ffffff 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(11, 95, 168, 0.12);
    --card-shadow: 0 12px 35px rgba(6, 42, 74, 0.08);
    --text-primary: var(--navy-malam);
    --text-secondary: var(--abu-klinik);
    --text-muted: #7a8b9a;
    --accent: linear-gradient(135deg, #0B5FA8 0%, #12B5A5 100%);
    --accent-glow: rgba(18, 181, 165, 0.28);
    --btn-other-bg: rgba(6, 42, 74, 0.04);
}

/* ==========================================================================
   2. GLOBAL & RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 20px;
    overflow: hidden;
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
    user-select: none;
    transition: background 0.5s ease, color 0.5s ease;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background: radial-gradient(circle at 50% 45%, var(--accent-glow), transparent 42%);
    pointer-events: none;
}

canvas {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
}

body:not(.light-mode) canvas {
    opacity: 0.82;
}

body.light-mode canvas {
    opacity: 0.48;
}

/* ==========================================================================
   3. ERROR CARD & GLITCH EFFECT
   ========================================================================== */
.error-card {
    width: 100%;
    max-width: 400px;
    padding: 32px 24px;
    overflow: hidden;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 10;
    transition: transform 0.3s ease;
}

.error-card:hover {
    transform: translateY(-4px);
}

.glitch-wrapper {
    margin-bottom: 8px;
}

.glitch-text {
    position: relative;
    display: inline-block;
    color: var(--accent);
    font-family: 'Fira Code', monospace;
    font-size: 80px;
    font-weight: 700;
    letter-spacing: -2px;
    text-shadow: 0 0 15px var(--accent-glow);
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.glitch-text::before {
    left: 2px;
    text-shadow: -2px 0 #E5484D;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitchAnim 3s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: -2px 0 #0B5FA8;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitchAnim2 2.5s infinite linear alternate-reverse;
}

@keyframes glitchAnim {
    0% { clip: rect(15px, 9999px, 40px, 0); }
    20% { clip: rect(60px, 9999px, 80px, 0); }
    40% { clip: rect(10px, 9999px, 30px, 0); }
    60% { clip: rect(45px, 9999px, 90px, 0); }
    80% { clip: rect(25px, 9999px, 50px, 0); }
    100% { clip: rect(70px, 9999px, 100px, 0); }
}

@keyframes glitchAnim2 {
    0% { clip: rect(50px, 9999px, 75px, 0); }
    20% { clip: rect(10px, 9999px, 35px, 0); }
    40% { clip: rect(80px, 9999px, 95px, 0); }
    60% { clip: rect(20px, 9999px, 60px, 0); }
    80% { clip: rect(40px, 9999px, 65px, 0); }
    100% { clip: rect(5px, 9999px, 25px, 0); }
}

.error-card h2 {
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.error-card p {
    margin-bottom: 16px;
    color: var(--text-secondary);
    font-size: 12px;
}

.redirect-info {
    display: inline-block;
    margin-bottom: 20px;
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 11px;
    background: var(--btn-other-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}

.redirect-info strong {
    color: var(--accent);
}

.action-wrapper {
    display: flex;
    justify-content: center;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: var(--putih);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background: var(--accent);
    border-radius: 12px;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* ==========================================================================
   4. FIXED WIDGETS (THEME TOGGLE & FOOTER)
   ========================================================================== */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: transform 0.3s ease, background 0.4s ease, border-color 0.4s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    border-color: var(--accent);
}

.theme-toggle i {
    color: var(--text-primary);
    font-size: 16px;
    transition: color 0.4s ease;
}

.footer-badge-fixed {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 6px 14px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 400;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.footer-badge-fixed strong {
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 480px) {
    .theme-toggle {
        top: 15px;
        right: 15px;
    }

    .footer-badge-fixed {
        right: 15px;
        bottom: 15px;
    }
}