:root {
    --bg-main: #050816;
    --bg-card: rgba(12, 18, 38, 0.92);
    --bg-card-light: rgba(22, 31, 59, 0.95);
    --primary: #00e5ff;
    --primary-soft: rgba(0, 229, 255, 0.16);
    --secondary: #8b5cf6;
    --secondary-soft: rgba(139, 92, 246, 0.18);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.22);
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, rgba(0, 229, 255, 0.14), transparent 34%), radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.26), transparent 36%), var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
}

.background-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
}

.login-card,
.dashboard-card {
    width: 100%;
    max-width: 450px;
    background: linear-gradient(145deg, var(--bg-card), rgba(9, 14, 30, 0.96));
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.dashboard-card {
    max-width: 850px;
}

    .login-card::before,
    .dashboard-card::before {
        content: "";
        position: absolute;
        inset: -1px;
        background: linear-gradient(120deg, rgba(0, 229, 255, 0.26), transparent 30%, rgba(139, 92, 246, 0.32));
        opacity: 0.45;
        z-index: -1;
    }

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

    .brand.small {
        margin-bottom: 0;
    }

    .brand h1 {
        font-size: 1.35rem;
        line-height: 1;
        letter-spacing: -0.04em;
    }

    .brand p {
        margin-top: 5px;
        color: var(--text-muted);
        font-size: 0.85rem;
    }

.logo-image-wrap {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: radial-gradient(circle at top, rgba(151, 71, 255, 0.35), transparent 60%), rgba(10, 8, 24, 0.92);
    border: 1px solid rgba(151, 71, 255, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 22px rgba(151, 71, 255, 0.38), inset 0 0 18px rgba(151, 71, 255, 0.12);
    flex-shrink: 0;
}

    .logo-image-wrap.small-logo {
        width: 56px;
        height: 56px;
        border-radius: 18px;
    }

.logo-image {
    width: 88%;
    height: 88%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 8px rgba(151, 71, 255, 0.65)) drop-shadow(0 0 14px rgba(120, 50, 255, 0.35));
}

.challenge-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--primary-soft);
    border: 1px solid rgba(0, 229, 255, 0.24);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 18px;
}

    .challenge-badge.medium {
        background: var(--secondary-soft);
        border-color: rgba(139, 92, 246, 0.35);
        color: #c4b5fd;
    }

.login-card h2 {
    font-size: 2rem;
    letter-spacing: -0.06em;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fecaca;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .input-group label {
        color: var(--text-muted);
        font-size: 0.83rem;
        font-weight: 600;
    }

    .input-group input {
        width: 100%;
        border: 1px solid var(--border);
        background: rgba(2, 6, 23, 0.55);
        color: var(--text-main);
        border-radius: 14px;
        padding: 14px 15px;
        outline: none;
        font-size: 0.95rem;
        transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

        .input-group input::placeholder {
            color: #64748b;
        }

        .input-group input:focus {
            border-color: rgba(139, 92, 246, 0.75);
            box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.14);
            background: rgba(2, 6, 23, 0.78);
        }

.btn-primary {
    margin-top: 4px;
    border: none;
    cursor: pointer;
    border-radius: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #020617;
    font-weight: 900;
    font-size: 0.96rem;
    box-shadow: 0 14px 40px rgba(139, 92, 246, 0.24);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

    .btn-primary:hover {
        transform: translateY(-1px);
        filter: brightness(1.06);
        box-shadow: 0 18px 46px rgba(139, 92, 246, 0.32);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

.hint-box {
    margin-top: 22px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px dashed rgba(148, 163, 184, 0.28);
}

.hint-title {
    display: block;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hint-box p {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* Dashboard */

.dashboard-page {
    align-items: center;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 18px;
}

.logout-btn {
    text-decoration: none;
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.08);
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.18s ease, transform 0.18s ease;
}

    .logout-btn:hover {
        background: rgba(239, 68, 68, 0.16);
        transform: translateY(-1px);
    }

.status-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-radius: 22px;
    margin-bottom: 22px;
}

    .status-panel.success {
        background: linear-gradient(135deg, rgba(34, 197, 94, 0.16), rgba(0, 229, 255, 0.08));
        border: 1px solid rgba(34, 197, 94, 0.28);
    }

    .status-panel.warning {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(139, 92, 246, 0.08));
        border: 1px solid rgba(245, 158, 11, 0.3);
    }

.status-label {
    display: inline-block;
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}

.warning-text {
    color: var(--warning);
}

.status-panel h2 {
    font-size: 2rem;
    letter-spacing: -0.06em;
    margin-bottom: 5px;
}

.status-panel p {
    color: var(--text-muted);
}

.status-icon {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.18);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 900;
    flex-shrink: 0;
}

.warning-icon {
    background: rgba(245, 158, 11, 0.16);
    color: #facc15;
    border-color: rgba(245, 158, 11, 0.35);
}

.flag-section {
    margin-bottom: 22px;
}

.flag-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    margin-bottom: 9px;
}

.flag-box {
    padding: 18px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.7);
    border: 1px solid rgba(0, 229, 255, 0.28);
    color: var(--primary);
    font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
    font-size: 1rem;
    overflow-wrap: anywhere;
    box-shadow: inset 0 0 30px rgba(0, 229, 255, 0.05);
}

.locked-box {
    margin-bottom: 22px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.62);
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.locked-title {
    display: block;
    color: #facc15;
    font-weight: 900;
    margin-bottom: 6px;
}

.locked-box p {
    color: var(--text-muted);
}

.locked-box code {
    color: var(--primary);
    background: rgba(0, 229, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
}

.token-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.info-card {
    padding: 16px;
    background: var(--bg-card-light);
    border: 1px solid var(--border);
    border-radius: 18px;
}

    .info-card span {
        display: block;
        color: var(--text-muted);
        font-size: 0.8rem;
        margin-bottom: 6px;
    }

    .info-card strong {
        font-size: 0.98rem;
        overflow-wrap: anywhere;
    }

.dashboard-hint {
    margin-top: 18px;
}

@media (max-width: 720px) {
    .token-info {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .status-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-card,
    .dashboard-card {
        padding: 24px;
        border-radius: 20px;
    }

        .login-card h2,
        .status-panel h2 {
            font-size: 1.65rem;
        }

    .brand h1 {
        font-size: 1.15rem;
    }

    .logo-image-wrap {
        width: 56px;
        height: 56px;
        border-radius: 18px;
    }
}
