/* ═══════════════════════════════════════════════════════════════════
   TECH SAAS CSS VARIABLES + MATERIAL DESIGN 3
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* SaaS Color System */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #10b981;
    --accent: #f59e0b;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    /* Text */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    /* Borders */
    --border-color: #e5e7eb;
    --border-color-hover: #d1d5db;
    
    /* Spacing (8px grid) */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --space-8: 64px;
    
    /* Border Radius (Material 3) */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #374151;
    --border-color-hover: #4b5563;
}

/* Apply theme to canvas */
html, body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    color-scheme: light dark;
}

/* ═══════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════ */

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   TYPOGRAPHY (Material 3 scale)
   ═══════════════════════════════════════════════════════════════════ */

h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; }
p { font-size: clamp(1rem, 2vw, 1.125rem); color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════
   NAV & HEADER (sticky + mobile)
   ═══════════════════════════════════════════════════════════════════ */

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

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

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.2s ease;
}

nav a:hover,
nav a.active {
    color: var(--primary);
}

.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1024px) {
    nav ul {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 1.5rem 2rem;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }
    nav ul.open {
        display: flex;
    }
    .mobile-nav-toggle {
        display: flex;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS (Material 3 rounded)
   ═══════════════════════════════════════════════════════════════════ */

.btn, .btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 24px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn:hover, .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 24px;
    padding: 12px 26px;
}

/* ═══════════════════════════════════════════════════════════════════
   CARDS (Material 3)
   ═══════════════════════════════════════════════════════════════════ */

.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.card img {
    border-radius: 12px;
    width: 100%;
    object-fit: cover;
}

/* ═══════════════════════════════════════════════════════════════════
   FORMS & INPUTS
   ═══════════════════════════════════════════════════════════════════ */

input, textarea, select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════
   LAYOUT & CONTAINER
   ═══════════════════════════════════════════════════════════════════ */

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

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

@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════════════════════════════════ */

.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 999;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

/* ═══════════════════════════════════════════════════════════════════
   SECTION SPACING
   ═══════════════════════════════════════════════════════════════════ */

section {
    padding: 64px 0;
}

/* ═══════════════════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════════════════ */

.active {
    color: var(--primary) !important;
    font-weight: 600;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Header nav spacing floor (normalizer): keep the brand and the
   menu separated when the flex container runs out of width. */
header nav, header nav > div { gap: 1rem; flex-wrap: wrap; }
@media (max-width: 1280px) { header nav ul { gap: 1rem; } }

/* Audit fix: missing class rules for contact form, hero, logo */
.contact-form {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-status {
    padding: var(--space-2);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    text-align: center;
    display: none;
}

.form-status.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
    border: 1px solid var(--secondary);
    display: block;
}

.form-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid #ef4444;
    display: block;
}

.hero {
    padding: var(--space-8) 0;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    text-align: center;
    position: relative;
}

.hero .container {
    max-width: 720px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}
