/* === Modern Light Theme === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p, div, section { outline: none; }

:root {
    --bg: #fafafa;
    --bg-card: #ffffff;
    --bg-hover: #edf4ff;
    --bg-dark-section: #0d1b33;
    --text: #0d1b33;
    --text-muted: #5a6b80;
    --text-on-dark: #edf2f8;
    --text-muted-on-dark: #8fa0b8;
    --accent: #1b82fa;
    --accent-hover: #1570de;
    --accent-light: #e5f0ff;
    --accent-glow: rgba(27,130,250,0.35);
    --green: #10b981;
    --red: #ef4444;
    --yellow: #f59e0b;
    --orange: #f0a04b;
    --border: #dce5f0;
    --border-dark: rgba(255,255,255,0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 3px rgba(26,16,51,0.06), 0 1px 2px rgba(26,16,51,0.04);
    --shadow-md: 0 4px 20px rgba(26,16,51,0.08);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='120'%3E%3Ctext x='10' y='30' font-family='Georgia,serif' font-size='16' font-style='italic' fill='%231b82fa' opacity='0.04'%3Emeow meow meow%3C/text%3E%3Ctext x='170' y='70' font-family='Georgia,serif' font-size='16' font-style='italic' fill='%231b82fa' opacity='0.04'%3Emeow meow meow%3C/text%3E%3Ctext x='50' y='110' font-family='Georgia,serif' font-size='16' font-style='italic' fill='%231b82fa' opacity='0.04'%3Emeow meow meow%3C/text%3E%3C/svg%3E");
    color: var(--text); line-height: 1.7; min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
.container { max-width: 1140px; margin: 0 auto; padding: 0 2rem; }

/* === Navigation === */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.8rem 2.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    position: sticky; top: 0; z-index: 100;
}
.navbar-brand {
    font-size: 1.4rem; font-weight: 900; color: var(--text);
    display: inline-flex; align-items: center; gap: 0.5rem; letter-spacing: -0.03em;
}
.navbar-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 0.5rem; align-items: center; }
.nav-links a { color: var(--text-muted); font-size: 0.88rem; font-weight: 500; transition: all var(--transition); }
.nav-links a:hover { color: var(--text); }
.nav-links .btn-primary { color: #fff; }
.nav-links .btn-primary:hover { color: #fff; }
.nav-badge {
    display: inline-block; padding: 0.25rem 0.8rem;
    background: rgba(16,185,129,0.1); color: var(--green);
    border: 1px solid rgba(16,185,129,0.2); border-radius: 100px;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}

/* === Buttons === */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.65rem 1.5rem; border-radius: var(--radius-sm);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    border: none; transition: all var(--transition); text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, #4da3ff 0%, #1b82fa 60%, #2d8ff5 100%); color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
    background: #fff;
    transform: translateY(-2px);
    -webkit-background-clip: text;
    background-clip: text;
    background-image: linear-gradient(135deg, #0d1b33 0%, #1b82fa 100%);
    -webkit-text-fill-color: transparent;
    box-shadow: inset 0 0 0 2px var(--accent), 0 8px 24px var(--accent-glow);
}
.btn-secondary {
    background: #fff; color: var(--text); border: 1.5px solid var(--border); box-shadow: var(--shadow-sm);
}
.btn-secondary:hover {
    border-color: var(--accent); background: var(--accent-light); transform: translateY(-1px);
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #fff;
}
.btn-sm { padding: 0.4rem 1rem; font-size: 0.82rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-nav {
    background: #fff; color: var(--text-muted); border: 1.5px solid var(--border);
    border-radius: 100px; padding: 0.4rem 1.2rem; box-shadow: var(--shadow-sm);
}
.btn-nav:hover {
    color: var(--accent); border-color: var(--accent); background: var(--accent-light);
}
.btn-tg {
    background: #229ED9; color: #fff !important; border-radius: 100px;
    padding: 0.4rem 1.2rem; display: inline-flex; align-items: center;
    box-shadow: 0 2px 8px rgba(34,158,217,0.35);
}
.btn-tg:hover {
    background: #1a8bbf; color: #fff !important; transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34,158,217,0.45);
}

/* === Cards === */
.card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.5rem; box-shadow: var(--shadow-sm); transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #c8d5e8; }

/* === Forms === */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.form-input {
    width: 100%; padding: 0.75rem 1rem; background: #fff;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 0.92rem; outline: none; transition: all var(--transition); font-family: inherit;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(27,130,250,0.1); }

/* === Hero === */
.hero {
    padding: 2.5rem 0 2rem;
    background: linear-gradient(170deg, #e5f0ff 0%, #f5faff 30%, #fff5eb 70%, #fafafa 100%);
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: -30%; right: -20%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(27,130,250,0.08) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none;
}
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.hero-text { flex: 1; }
.hero h1 {
    font-size: 2.24rem; font-weight: 900; line-height: 1.1;
    margin-bottom: 0.7rem; letter-spacing: -0.04em; position: relative; text-align: left; color: var(--text);
}
.hero h1 span {
    background: linear-gradient(135deg, #1b82fa 0%, #e87d7d 50%, #f0a04b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p {
    font-size: 1.05rem; color: var(--text-muted); max-width: 480px;
    margin: 0 0 1rem; line-height: 1.6; text-align: left;
}
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-badge {
    display: inline-block; padding: 0.4rem 1rem; margin-bottom: 1.2rem;
    background: rgba(16,185,129,0.1); color: var(--green);
    border: 1px solid rgba(16,185,129,0.2); border-radius: 100px; font-size: 0.82rem; font-weight: 600;
}

/* === Benefits Row === */
.benefits-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; text-align: center; }
.benefit-item { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.benefit-icon { font-size: 1.8rem; }
.benefit-item h3 { font-size: 0.92rem; font-weight: 700; margin: 0; }
.benefit-item p { color: var(--text-muted); font-size: 0.8rem; margin: 0; line-height: 1.4; }

/* === Stats Row === */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; padding: 1rem 0; }
.stat-item .stat-value {
    font-size: 3rem; font-weight: 900; letter-spacing: -0.03em;
    background: linear-gradient(135deg, #1b82fa 0%, #f0a04b 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent;
}
.stat-item .stat-label { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.3rem; line-height: 1.4; }

/* === Features === */
.features { padding: 2.5rem 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; }
.features-grid.four-col { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature-card { padding: 1.5rem; position: relative; overflow: hidden; background: #fff; }
.feature-card::after {
    content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--orange));
    transform: scaleX(0); transform-origin: left; transition: transform var(--transition);
}
.feature-card:hover::after { transform: scaleX(1); }
.feature-icon { font-size: 2rem; margin-bottom: 0.6rem; }
.feature-card h3 { margin-bottom: 0.5rem; font-size: 1.05rem; font-weight: 700; }
.feature-card p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.65; }

/* === Section === */
.section { padding: 3rem 0; }
.section.compact { padding: 2rem 0; }
.section-title { font-size: 1.8rem; font-weight: 800; text-align: center; margin-bottom: 0.4rem; letter-spacing: -0.03em; color: var(--text); }
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2rem; font-size: 0.95rem; }

/* === Pricing === */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.pricing-card { text-align: center; padding: 1.8rem 1.5rem; position: relative; background: #fff; display: flex; flex-direction: column; }
.pricing-card .btn { margin-top: auto; }
.pricing-card.popular { border: 2px solid var(--accent); box-shadow: 0 8px 32px rgba(27,130,250,0.12); transform: scale(1.03); }
.pricing-card.popular:hover { transform: scale(1.05); }
.pricing-badge {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, #1b82fa 0%, #1468d0 100%); color: #fff;
    padding: 0.3rem 1.2rem; border-radius: 100px; font-size: 0.72rem; font-weight: 700;
    white-space: nowrap; box-shadow: 0 4px 12px var(--accent-glow);
}
.pricing-price { font-size: 2.8rem; font-weight: 900; margin: 1rem 0 0.3rem; letter-spacing: -0.03em; color: var(--text); }
.pricing-period { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }
.pricing-features { list-style: none; margin-bottom: 2rem; }
.pricing-features li {
    padding: 0.4rem 0; color: var(--text-muted); font-size: 0.88rem;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.pricing-features li::before { content: "✓"; color: var(--green); font-weight: 700; font-size: 1rem; }

/* === How it works === */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; text-align: center; }
.step-number {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #1b82fa 0%, #1468d0 100%); color: #fff;
    font-weight: 800; font-size: 1.3rem;
    display: inline-flex; align-items: center; justify-content: center;
    margin-bottom: 1.2rem; box-shadow: 0 6px 20px var(--accent-glow);
}

/* === Status === */
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.5rem; }
.status-online { background: var(--green); box-shadow: 0 0 8px rgba(16,185,129,0.4); }
.status-offline { background: var(--red); }

/* === Table === */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.85rem 1.2rem; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
td { font-size: 0.88rem; }
tr { transition: background var(--transition); }
tr:hover td { background: var(--bg-hover); }

/* === Dashboard === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { padding: 1.5rem; }
.stat-value { font-size: 2rem; font-weight: 900; }
.stat-label { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.2rem; }

/* === Auth === */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 80vh; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; font-weight: 800; }
.auth-toggle { text-align: center; margin-top: 1.2rem; font-size: 0.88rem; color: var(--text-muted); }
.error-msg { color: var(--red); font-size: 0.85rem; margin-bottom: 1rem; text-align: center; }

/* === Footer === */
.footer {
    background: var(--bg-dark-section); padding: 2.5rem 2rem 1.5rem;
    color: var(--text-muted-on-dark); font-size: 0.85rem; margin-top: 0;
}
.footer a { color: var(--text-muted-on-dark); }
.footer a:hover { color: var(--text-on-dark); }
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem; margin-bottom: 1.5rem;
}
.footer-col { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col h4 { color: var(--text-on-dark); font-size: 0.88rem; font-weight: 700; margin-bottom: 0.6rem; }
.footer-col a { font-size: 0.82rem; transition: color var(--transition); }
.footer-bottom {
    border-top: 1px solid var(--border-dark); padding-top: 1.5rem;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
}
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { font-size: 0.78rem; }

/* === Badges === */
.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.7rem; border-radius: 100px; font-size: 0.72rem; font-weight: 600; }
.badge-green { background: rgba(16,185,129,0.1); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.1); color: var(--red); }
.badge-yellow { background: rgba(245,158,11,0.1); color: var(--yellow); }
.badge-blue { background: rgba(27,130,250,0.1); color: var(--accent); }

/* === Utilities === */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }

/* === Config download === */
.config-box {
    background: #f0f5fa; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1.2rem;
    font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: 0.8rem;
    white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow-y: auto; color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.6rem; }
    .hero-row { flex-direction: column-reverse; text-align: center; }
    .hero-text { text-align: center; }
    .hero h1, .hero p { text-align: center; }
    .hero-buttons { justify-content: center; }
    .navbar { padding: 0.7rem 1rem; }
    .nav-links { gap: 0.3rem; }
    .navbar-cat { display: none; }
    .mascot-img { width: 180px; height: auto; }
    .container { padding: 0 1rem; }
    .section { padding: 1.5rem 0; }
    .features { padding: 2rem 0; }
    .pricing-grid { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; }
    .pricing-card.popular { transform: scale(1); }
    .benefits-row { grid-template-columns: repeat(3, 1fr); }
    .card { padding: 1rem; border-radius: 12px; }
    .card:hover { transform: none; }
    .btn { padding: 0.55rem 1.2rem; font-size: 0.85rem; }
    .btn-sm { padding: 0.35rem 0.8rem; font-size: 0.78rem; }
    .section-title { font-size: 1.4rem; }
    .nav-badge { display: none; }
    .nav-links .btn-nav { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
    .footer-bottom { flex-direction: column; text-align: center; }
    table { font-size: 0.82rem; }
    th, td { padding: 0.6rem 0.8rem; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 1.28rem; }
    .btn-lg { padding: 0.7rem 1.5rem; font-size: 0.9rem; }
    .footer-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr; gap: 1rem; }
    .benefits-row { grid-template-columns: 1fr; }
    .navbar { padding: 0.6rem 0.8rem; }
    .navbar-brand { font-size: 1.1rem; }
    .container { padding: 0 0.8rem; }
}

/* === Device card (cabinet) === */
.device-card { transition: all var(--transition); }
.device-actions { display: flex; gap: 0.4rem; margin-top: 0.4rem; flex-wrap: wrap; }
.add-device-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.btn-icon {
    background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0.2rem 0.4rem;
    border-radius: 6px; transition: background var(--transition); line-height: 1;
}
.btn-icon:hover { background: var(--bg-hover); }

/* === Animated Cat (navbar) === */
.navbar-cat {
    flex-shrink: 0; animation: catBob 2.5s ease-in-out infinite;
    filter: drop-shadow(0 2px 6px rgba(244,170,65,0.3));
}
.cat-eye-blink { animation: catBlinkNew 4s ease-in-out infinite; transform-origin: center; }

@keyframes catBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes catBlinkNew {
    0%, 40% { ry: 2.08; }
    43% { ry: 0.3; }
    46% { ry: 2.08; }
    100% { ry: 2.08; }
}

/* === Hero Mascot === */
.hero-cat { flex-shrink: 0; position: relative; }
.mascot-wrapper {
    position: relative; display: inline-block;
    animation: mascotFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 12px 32px rgba(232,145,58,0.25));
}
.mascot-img { display: block; animation: mascotWag 1.5s ease-in-out infinite; transform-origin: 50% 85%; }

@keyframes mascotFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes mascotWag { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(2deg); } 75% { transform: rotate(-2deg); } }
