:root {
    --bg-primary: #0b0f1a;
    --bg-secondary: #131a2e;
    --bg-surface: #1a2240;
    --text-primary: #f1f5f9;
    --text-secondary: #8892a8;
    --text-muted: #4a5568;
    --accent-blue: #38bdf8;
    --accent-violet: #a78bfa;
    --accent-cyan: #22d3ee;
    --accent-emerald: #34d399;
    --accent-gradient: linear-gradient(135deg, #38bdf8, #a78bfa);
    --accent-gradient-hover: linear-gradient(135deg, #7dd3fc, #c4b5fd);
    --glass-bg: rgba(19, 26, 46, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Background */
.bg-effects {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-blue);
    top: -200px;
    right: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-violet);
    bottom: -150px;
    left: -100px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent-cyan);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.08;
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -40px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(40px, 30px) scale(1.02);
    }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

/* Glass */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Views */
.view {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--ease), visibility 0.5s;
}

.view.active {
    opacity: 1;
    visibility: visible;
}

.hidden {
    display: none !important;
}

/* Login */
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px 36px;
    border-radius: var(--radius-xl);
    text-align: center;
    transform: translateY(10px);
    animation: slideUp 0.6s var(--ease) forwards;
}

@keyframes slideUp {
    to {
        transform: translateY(0);
    }
}

.brand {
    margin-bottom: 36px;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    font-size: 24px;
    font-weight: 800;
    color: var(--bg-primary);
    margin-bottom: 16px;
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.3);
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 6px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 8px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color 0.3s var(--ease);
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s var(--ease);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group input:focus {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.04);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.input-group:focus-within .input-icon {
    color: var(--accent-blue);
}

.btn-primary {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    color: var(--bg-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease);
    margin-top: 4px;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient-hover);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-text,
.btn-loader {
    position: relative;
    z-index: 1;
}

.btn-loader {
    width: 20px;
    height: 20px;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .btn-loader {
    display: inline-block;
}

.error-msg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #f87171;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: rgba(248, 113, 113, 0.08);
    animation: shake 0.4s var(--ease);
}

.error-msg svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0)
    }

    20% {
        transform: translateX(-8px)
    }

    40% {
        transform: translateX(8px)
    }

    60% {
        transform: translateX(-4px)
    }

    80% {
        transform: translateX(4px)
    }
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* Dashboard */
#dashboard-view {
    flex-direction: column;
    align-items: stretch;
}

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(11, 15, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10;
}

.brand-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-mark-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    font-size: 14px;
    font-weight: 800;
    color: var(--bg-primary);
}

.brand-name {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
}

.btn-ghost {
    padding: 8px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.dash-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    gap: 40px;
}

.welcome {
    text-align: center;
}

.welcome h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 960px;
    width: 100%;
}

.service-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.4s var(--ease);
    cursor: pointer;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-glow {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0;
    transition: opacity 0.5s var(--ease);
    pointer-events: none;
}

.glow-blue {
    background: var(--accent-blue);
}

.glow-violet {
    background: var(--accent-violet);
}

.glow-emerald {
    background: var(--accent-emerald);
}

.service-card:hover .card-glow {
    opacity: 0.12;
}

.card-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    transition: all 0.3s var(--ease);
}

.card-icon svg {
    width: 26px;
    height: 26px;
}

.icon-blue {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-blue);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.icon-violet {
    background: rgba(167, 139, 250, 0.1);
    color: var(--accent-violet);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.icon-emerald {
    background: rgba(52, 211, 153, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.service-card:hover .icon-blue {
    background: rgba(56, 189, 248, 0.18);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.service-card:hover .icon-violet {
    background: rgba(167, 139, 250, 0.18);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.2);
}

.service-card:hover .icon-emerald {
    background: rgba(52, 211, 153, 0.18);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.2);
}

.card-info {
    flex: 1;
    min-width: 0;
}

.card-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    letter-spacing: 0.3px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.card-arrow {
    flex-shrink: 0;
    color: var(--text-muted);
    transition: all 0.3s var(--ease);
}

.card-arrow svg {
    width: 20px;
    height: 20px;
}

.service-card:hover .card-arrow {
    color: var(--text-primary);
    transform: translateX(4px);
}

.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 14px 28px;
    border-radius: 100px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.online {
    background: #34d399;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.5
    }
}

.dash-footer {
    text-align: center;
    padding: 16px 32px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .login-card {
        max-width: 360px;
        padding: 36px 28px 28px;
    }

    .services-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .dash-header {
        padding: 12px 20px;
    }

    .dash-content {
        padding: 32px 20px;
    }

    .status-bar {
        flex-direction: column;
        gap: 12px;
        border-radius: var(--radius-md);
    }

    .welcome h2 {
        font-size: 1.4rem;
    }
}