*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0b0f14;
    --bg-secondary: #111820;
    --bg-card: #151d27;
    --border: #1e2a3a;
    --border-light: #2a3a4f;
    --text-primary: #e6edf3;
    --text-secondary: #8b9cb3;
    --text-muted: #5c6b7f;
    --accent-green: #3fb950;
    --accent-amber: #d29922;
    --accent-red: #f85149;
    --accent-blue: #58a6ff;
    --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(30, 42, 58, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 42, 58, 0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.grid-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(63, 185, 80, 0.06) 0%, transparent 60%);
}

/* Decorative background charts (not real data) */
.chart-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.chart-bg__panel {
    position: absolute;
    opacity: 0.28;
    border: 1px dashed var(--border-light);
    border-radius: 8px;
    padding: 14px 16px 12px;
    background:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 6px,
            rgba(30, 42, 58, 0.25) 6px,
            rgba(30, 42, 58, 0.25) 7px
        ),
        rgba(17, 24, 32, 0.6);
    box-shadow: 0 0 24px rgba(63, 185, 80, 0.06);
}

.chart-bg__label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.3em;
    margin-bottom: 6px;
    text-align: center;
}

.chart-bg__panel--left {
    left: 2%;
    top: 14%;
    width: 280px;
    height: 130px;
}

.chart-bg__panel--right {
    right: 2%;
    top: 16%;
    width: 280px;
    height: 130px;
}

.chart-bg__panel--bottom {
    left: 50%;
    bottom: 6%;
    transform: translateX(-50%);
    width: 420px;
    height: 110px;
}

.chart-bg__svg {
    width: 100%;
    height: 85px;
    display: block;
    filter: drop-shadow(0 0 6px rgba(63, 185, 80, 0.35));
}

.chart-bg__grid {
    stroke: var(--border-light);
    stroke-width: 0.75;
    stroke-dasharray: 4 6;
    opacity: 0.8;
}

.chart-bg__line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    animation: chartBgDraw 6s ease-in-out infinite;
}

.chart-bg__line--1 {
    stroke: var(--accent-green);
}

.chart-bg__line--2 {
    stroke: var(--accent-blue);
    animation-delay: -2.5s;
    filter: drop-shadow(0 0 6px rgba(88, 166, 255, 0.4));
}

.chart-bg__bars {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 68px;
    padding-top: 4px;
    filter: drop-shadow(0 0 8px rgba(63, 185, 80, 0.3));
}

.chart-bg__bar {
    flex: 1;
    height: var(--h);
    background: linear-gradient(to top, rgba(63, 185, 80, 0.5), var(--accent-green));
    border-radius: 3px 3px 0 0;
    opacity: 0.85;
    transform-origin: bottom;
    animation: chartBgBars 5s ease-in-out infinite;
    animation-delay: var(--d);
}

@keyframes chartBgDraw {
    0%, 100% {
        stroke-dashoffset: 500;
        opacity: 0.35;
    }
    12% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    45% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
    88% {
        stroke-dashoffset: 500;
        opacity: 0.35;
    }
}

@keyframes chartBgBars {
    0%, 100% {
        transform: scaleY(0.1);
        opacity: 0.35;
    }
    18% {
        transform: scaleY(1);
        opacity: 0.95;
    }
    50% {
        transform: scaleY(1);
        opacity: 0.95;
    }
    82% {
        transform: scaleY(0.1);
        opacity: 0.35;
    }
}

@media (max-width: 900px) {
    .chart-bg__panel--left,
    .chart-bg__panel--right {
        display: none;
    }

    .chart-bg__panel--bottom {
        width: 85%;
        opacity: 0.2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chart-bg__line,
    .chart-bg__bar {
        animation: none;
        stroke-dashoffset: 0;
        opacity: 0.3;
        transform: scaleY(0.5);
    }
}

/* Header */
.header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 15, 20, 0.85);
    backdrop-filter: blur(8px);
}

.header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header__logo {
    width: 28px;
    height: 28px;
    color: var(--accent-green);
}

.header__title {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.header__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.4); }
    50% { opacity: 0.7; box-shadow: 0 0 0 6px rgba(63, 185, 80, 0); }
}

/* Main */
.main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 48px;
    padding: 40px 24px;
}

/* Login card */
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 36px 32px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-card__header {
    margin-bottom: 28px;
}

.login-card__title {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.login-card__subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Alerts */
.alert {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.alert__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert__title {
    font-weight: 500;
    margin-bottom: 2px;
}

.alert__text {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.alert--error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid rgba(248, 81, 73, 0.3);
    color: var(--accent-red);
}

.alert--blocked {
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid rgba(210, 153, 34, 0.3);
    color: var(--accent-amber);
}

/* Blocked info */
.blocked-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.metric__label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.metric__value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
}

.metric__value--error {
    color: var(--accent-red);
}

.metric__value--warning {
    color: var(--accent-amber);
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group__label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.form-group__input {
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group__input::placeholder {
    color: var(--text-muted);
}

.form-group__input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.btn {
    margin-top: 6px;
    padding: 11px 20px;
    background: var(--accent-green);
    color: #0b0f14;
    border: none;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    background: #4cc95e;
}

.btn:active {
    transform: scale(0.98);
}

/* Side metrics */
.side-metrics {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 200px;
}

.side-metric {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.side-metric__label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.side-metric__value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--accent-green);
}

.side-metric__value--warning {
    color: var(--accent-amber);
}

.side-metric__value--error {
    color: var(--accent-red);
}

/* Footer */
.footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(11, 15, 20, 0.85);
}

.footer__sep {
    color: var(--border-light);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 14px 20px;
    }

    .main {
        flex-direction: column;
        gap: 24px;
    }

    .side-metrics {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: unset;
        width: 100%;
        max-width: 420px;
    }

    .side-metric {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
    }

    .header__status span:last-child {
        display: none;
    }

    .header__status {
        padding: 6px 10px;
    }
}
