:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: #1e293b;
    --text-white: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --success: #22c55e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Auth Pages */
.auth-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    margin: 10% auto;
}

h2 { margin-bottom: 1.5rem; text-align: center; }

.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.5rem; color: var(--text-muted); }
input {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid #334155;
    color: white;
    border-radius: 0.5rem;
    outline: none;
}
input:focus { border-color: var(--primary); }

button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}
button:hover { background: var(--primary-hover); }

/* Main Dashboard */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 1rem;
}

.card h3 { margin-bottom: 1rem; border-bottom: 1px solid #334155; padding-bottom: 0.5rem; color: var(--primary); }

.device-item {
    background: #111827;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}
.online { background: var(--success); }
.offline { background: var(--text-muted); }

.hidden { display: none; }

.controls { margin-top: 1rem; display: flex; gap: 0.5rem; }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-danger { background: var(--danger); }
.btn-secondary { background: #475569; }

/* Linking Modal */
.modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 100;
}
.modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 1rem;
    width: 90%;
    max-width: 450px;
}

/* --- Landing Page Premium Styles --- */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand {
    font-weight: 800; 
    font-size: 1.5rem; 
    background: linear-gradient(to right, #818cf8, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.hero {
    padding: 8rem 1rem 10rem;
    text-align: center;
    background: linear-gradient(-45deg, #0f172a, #1e293b, #211c47, #0f172a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #e0e7ff, #818cf8, var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 40px rgba(99,102,241,0.2);
    letter-spacing: -1.5px;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease forwards;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.cta-group {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 999px; /* Pill shape */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-block;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
    border: 1px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99,102,241,0.6);
}

.btn-outline {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-white);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.2);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 6rem 1rem;
}

.feature-card {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 2.5rem;
    border-radius: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    transition: left 0.7s ease;
}

.feature-card:hover::before {
    left: 150%;
}

.feature-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(99,102,241,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.02);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    background: rgba(99,102,241,0.1);
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid rgba(99,102,241,0.2);
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-white);
    font-weight: 700;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Responsive fixes */
@media (max-width: 768px) {
    .hero h1 { font-size: 3rem; }
    .hero { padding: 6rem 1rem; }
    .cta-group { flex-direction: column; }
    .btn-large { width: 100%; text-align: center; }
}
