/* =======================================================
   TGJoin — Ultra-Professional Design System
   SaaS Aesthetic: Clean, High-Tech, Soft Mesh Glows
   ======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ─── Tokens ─── */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #eef2ff;
    --accent: #0f172a;

    --gradient-text: linear-gradient(135deg, #3b82f6 0%, #6366f1 40%, #8b5cf6 70%, #ec4899 100%);
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-cta: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #3b0764 100%);
    --bg-mesh: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 20%, rgba(236, 72, 153, 0.07) 0%, transparent 45%),
              radial-gradient(circle at 50% 60%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);

    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;

    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;
    --text: #0f172a;
    --text-secondary: #475569;
    --text-disabled: #94a3b8;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 45px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 10px 30px -5px rgba(99, 102, 241, 0.3);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

body.menu-open {
    overflow: hidden;
}

a { text-decoration: none; color: var(--primary); transition: all 0.2s ease; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
h1,h2,h3,h4,h5,h6 { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; color: var(--text); line-height: 1.25; }

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ─── Layout ─── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ─── Site Header (Marketing) ─── */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: 72px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    display: flex; align-items: center;
    transition: all 0.3s ease;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span { color: var(--primary); }

.logo img, .auth-logo img {
    max-width: 100%;
    width: auto;
    object-fit: contain;
}
.logo img {
    height: 32px;
}
.auth-logo img {
    height: 40px;
    margin: 0 auto;
}

.logo-badge {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--gradient-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:not(.btn) {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
}

.nav-links a:not(.btn):hover {
    background: var(--surface-2);
    color: var(--text);
}

/* ─── App Header (Dashboard) ─── */
header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 56px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

header .header-inner { padding: 0 24px; }

header .logo {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

header .nav-links a {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 12px;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    white-space: nowrap;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    line-height: 20px;
}

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

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-1);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #c5221f; }

.btn-lg { padding: 10px 24px; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm); }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn-block { display: flex; width: 100%; }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.1px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
    line-height: 20px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.form-control:disabled {
    background: var(--surface-2);
    color: var(--text-disabled);
    cursor: not-allowed;
}

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

/* ─── Cards ─── */
.card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 16px;
}

.card-elevated {
    background: var(--surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-1);
    padding: 24px;
    margin-bottom: 16px;
    border: none;
}

/* ─── Alerts ─── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-warning { background: var(--warning-bg); color: var(--warning); }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge-active { background: var(--success-bg); color: var(--success); }
.badge-pending { background: var(--warning-bg); color: var(--warning); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-verification { background: #e8f0fe; color: #1a73e8; }

/* ─── Dashboard Layout ─── */
.dashboard-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 12px 8px;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 2px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.sidebar-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.main-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    max-width: 100%;
    min-width: 0;
}

/* ─── Grid ─── */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ─── Tables ─── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { font-weight: 600; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table th { font-weight: 600; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--surface-2); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ─── Auth Pages ─── */
.auth-page {
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 70px);
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-1);
}

.auth-logo {
    display: block;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.auth-logo span { color: var(--primary); }

.auth-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.auth-sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ─── Hero Section ─── */
.hero-section {
    position: relative;
    padding: 140px 0 90px;
    background: var(--surface);
    background-image: var(--bg-mesh);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 350px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.08) 50%, transparent 70%);
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.hero-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(238, 242, 255, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary-dark);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(8px);
}

.hero-badge-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.12;
    letter-spacing: -2px;
    margin-bottom: 24px;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 56px;
}

.btn-hero-primary {
    background: var(--gradient-primary);
    color: #ffffff !important;
    padding: 14px 32px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.5);
    transition: all 0.3s ease;
    border: none;
}

.btn-hero-primary:hover {
    background: var(--gradient-primary);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -6px rgba(79, 70, 229, 0.6);
    filter: brightness(1.1);
}

.btn-hero-secondary {
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px 28px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.btn-hero-secondary:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
    transform: translateY(-2px);
}

/* Hero Showcase Card */
.hero-showcase {
    position: relative;
    max-width: 860px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0,0,0,0.02);
}

.showcase-inner {
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    position: relative;
}

.showcase-img-container {
    height: 380px;
    background: linear-gradient(135deg, #1e1b4b 0%, #311042 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.showcase-preview-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 32px;
    width: 380px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    color: white;
}

.showcase-preview-card .channel-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-primary);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.4);
}

.showcase-badge-floating {
    position: absolute;
    bottom: 24px;
    right: 24px;
    background: #ffffff;
    border-radius: var(--radius-full);
    padding: 10px 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    z-index: 10;
}

.showcase-badge-floating .status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

/* ─── Hero Interactive Demo ─── */
.hero-section {
    padding-bottom: 56px;
}

.hero-demo-wrapper {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 32px;
    align-items: start;
    padding-top: 48px;
    padding-bottom: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Editor Panel */
.demo-editor-panel {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.demo-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

.demo-editor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.demo-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.demo-theme-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface-3);
    border-radius: 8px;
    padding: 3px;
}

.demo-theme-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.demo-theme-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.demo-editor-fields {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.demo-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.demo-field-row {
    display: flex;
    gap: 10px;
}

.demo-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.4;
}

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

.demo-textarea {
    resize: none;
    min-height: 54px;
}

.demo-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-color-input {
    width: 44px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.demo-color-hex {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: monospace;
}

.demo-go-live-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 16px 12px;
    padding: 13px 20px;
    background: linear-gradient(135deg, #0f172a, #1e1b4b);
    color: #ffffff;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
    transition: all 0.25s;
    text-decoration: none;
}

.demo-go-live-btn:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.4);
}

.demo-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-disabled);
    padding: 0 16px 14px;
    margin: 0;
}

/* Device Frame */
.demo-device-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.demo-device-outer {
    width: 280px;
    height: 560px;
    background: #1a1a2e;
    border-radius: 44px;
    border: 8px solid #1a1a2e;
    box-shadow:
        0 0 0 1px #333,
        0 30px 60px rgba(0,0,0,0.3),
        inset 0 0 0 1px rgba(255,255,255,0.08);
    position: relative;
    overflow: hidden;
}

.demo-device-notch {
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 70px; height: 18px;
    background: #1a1a2e;
    border-radius: 10px;
    z-index: 10;
}

.demo-device-screen {
    width: 100%;
    height: 100%;
    border-radius: 36px;
    overflow: hidden;
    background: #fff;
    position: relative;
}

.demo-device-screen iframe {
    width: 375px;
    height: 700px;
    border: none;
    transform: scale(0.69);
    transform-origin: top left;
    position: absolute;
    top: 0; left: 0;
    pointer-events: none;
}

.demo-device-home {
    position: absolute;
    bottom: 8px; left: 50%;
    transform: translateX(-50%);
    width: 80px; height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.demo-device-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.demo-device-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    flex-shrink: 0;
}

/* Demo Responsive */
@media (max-width: 900px) {
    .hero-demo-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-top: 32px;
    }
    .demo-device-outer {
        width: 240px;
        height: 480px;
        border-radius: 36px;
        border-width: 6px;
    }
    .demo-device-screen iframe {
        transform: scale(0.59);
        transform-origin: top left;
    }
}

@media (max-width: 600px) {
    .hero-demo-wrapper {
        padding-top: 24px;
    }
    .demo-editor-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .demo-theme-tabs { width: 100%; justify-content: space-between; }
    .demo-theme-btn { flex: 1; text-align: center; }
    .demo-device-outer {
        width: 220px;
        height: 440px;
        border-radius: 32px;
        border-width: 5px;
    }
    .demo-device-screen iframe {
        transform: scale(0.55);
    }
}

/* Stats Section */
.stats-section {
    padding: 48px 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 16px;
    width: 100%;
}

.stat-item {
    text-align: center;
    min-width: 0; /* prevent overflow */
    overflow: hidden;
}

.stat-number {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: normal;
    word-break: break-word;
}

/* ─── Section Styles ─── */
.section-tag {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.section-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    color: var(--text);
}

.section-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 540px;
    line-height: 1.6;
}

.section-header { margin-bottom: 56px; }

/* ─── Features ─── */
.features-section {
    padding: 90px 0;
    background: var(--bg);
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.feature-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 20px;
}

.feature-icon-blue { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.feature-icon-purple { background: #f5f3ff; color: #7c3aed; border: 1px solid #ede9fe; }
.feature-icon-green { background: #ecfdf5; color: #059669; border: 1px solid #d1fae5; }
.feature-icon-rose { background: #fff1f2; color: #e11d48; border: 1px solid #ffe4e6; }
.feature-icon-cyan { background: #ecfeff; color: #0891b2; border: 1px solid #cffafe; }
.feature-icon-amber { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }

.feature-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── Steps Section ("How it works") ─── */
.steps-section {
    padding: 90px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 36px 28px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.step-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.step-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.step-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── Pricing Section ─── */
.pricing-section {
    padding: 90px 0;
    background: var(--bg);
}

.grid-4-plans {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1140px;
    margin: 0 auto;
    align-items: stretch;
}

.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-glow);
    transform: scale(1.03);
    z-index: 2;
}

.featured-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-primary);
    color: white;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.pricing-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.pricing-price {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 48px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -1.5px;
    line-height: 1;
    margin-bottom: 6px;
}

.pricing-price sup { font-size: 22px; font-weight: 700; vertical-align: top; margin-top: 4px; }
.pricing-period { font-size: 13px; color: var(--text-disabled); margin-bottom: 28px; }

.pricing-features { list-style: none; text-align: left; margin-bottom: 32px; flex: 1; }
.pricing-features li {
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--surface-2);
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li svg { color: var(--success); flex-shrink: 0; }

/* ─── FAQ Section ─── */
.faq-section {
    padding: 90px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.faq-container {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-card:hover {
    border-color: var(--border-strong);
}

.faq-question {
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.faq-card.open .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 24px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.faq-card.open .faq-answer {
    max-height: 200px;
    padding: 0 24px 20px 24px;
}

/* ─── Dark CTA Banner Section ─── */
.cta-banner-section {
    padding: 80px 0;
    background: var(--bg);
}

.cta-banner-card {
    background: var(--gradient-cta);
    border-radius: var(--radius-xl);
    padding: 64px 32px;
    text-align: center;
    color: white;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.4);
    position: relative;
    overflow: hidden;
}

.cta-banner-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.cta-title {
    font-size: 40px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1px;
    margin-bottom: 16px;
    position: relative;
}

.cta-desc {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 500px;
    margin: 0 auto 36px;
    line-height: 1.6;
    position: relative;
}

.btn-cta-white {
    background: #ffffff;
    color: #0f172a;
    padding: 14px 36px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.25s ease;
    display: inline-block;
    position: relative;
}

.btn-cta-white:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* ─── Footer ─── */
.site-footer {
    background: #0b0f17;
    color: rgba(255,255,255,0.6);
    padding: 64px 0 32px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand .logo { color: #fff; font-size: 20px; margin-bottom: 14px; display: inline-flex; }
.footer-brand p { font-size: 14px; line-height: 1.6; max-width: 280px; color: rgba(255,255,255,0.5); }

.footer-col h4 {
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}
.footer-col a {
    display: block;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    margin-bottom: 10px;
    transition: color 0.2s;
}
.footer-col a:hover { color: #ffffff; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

/* ─── Legal ─── */
.legal-page { padding: 80px 0; min-height: 100vh; }

.legal-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.legal-body h2 { font-size: 18px; margin: 32px 0 12px; color: var(--text); font-weight: 600; }
.legal-body h3 { font-size: 15px; margin: 20px 0 8px; color: var(--text); font-weight: 600; }
.legal-body p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 12px; font-size: 14px; }
.legal-body ul { padding-left: 20px; margin-bottom: 12px; }
.legal-body ul li { color: var(--text-secondary); line-height: 1.8; margin-bottom: 4px; font-size: 14px; }
.legal-body strong { color: var(--text); }

/* ─── Mobile Menu Button ─── */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text);
    line-height: 1;
    border-radius: var(--radius-xs);
    transition: background 0.2s ease;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn:hover {
    background: var(--surface-2);
}

/* ─── Mobile Sidebar ─── */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;  /* CRITICAL: don't block clicks when invisible */
    transition: opacity 0.3s ease;
}

.mobile-sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;  /* allow clicks on backdrop to close sidebar */
}

.mobile-sidebar {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 290px;
    background: #0d1b2e;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -8px 0 30px rgba(0,0,0,0.3);
    border-left: 1px solid rgba(255,255,255,0.08);
}

.mobile-sidebar.open {
    transform: translateX(0);
}

.sidebar-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header-bar .logo {
    color: #fff;
    font-size: 18px;
}

.sidebar-header-bar .logo-badge {
    width: 26px;
    height: 26px;
    font-size: 12px;
}

.sidebar-close-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.sidebar-close-btn:hover {
    background: rgba(255,255,255,0.15);
}

.sidebar-nav-links {
    display: flex;
    flex-direction: column;
    padding: 12px 12px;
    gap: 2px;
    flex: 1;
}

.sidebar-nav-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.sidebar-nav-links a:hover {
    background: rgba(255,255,255,0.08);
    color: #ffffff;
}

.sidebar-nav-links a svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-cta-group {
    padding: 16px 16px 32px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-btn-signin {
    display: block;
    text-align: center;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.15);
    transition: background 0.2s;
}

.sidebar-btn-signin:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-btn-getstarted {
    display: block;
    text-align: center;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 4px 14px rgba(79,70,229,0.4);
    transition: opacity 0.2s, transform 0.2s;
}

.sidebar-btn-getstarted:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    color: #fff;
}

/* ─── Responsive Breakpoints ─── */
@media (max-width: 1024px) {
    .grid-4-plans { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 44px; }
}

@media (max-width: 768px) {
    /* Show hamburger button */
    .mobile-menu-btn { display: flex; }

    /* Show sidebar overlay only on mobile */
    .mobile-sidebar-overlay { display: block; }

    /* Header */
    .site-header { height: 60px; }

    /* Hide desktop nav completely on mobile */
    .site-header .nav-links { display: none !important; }

    /* Dashboard sidebar */
    .dashboard-layout { flex-direction: column; }
    .sidebar {
        width: 100%; height: auto; position: static;
        border-right: none; border-bottom: 1px solid var(--border);
        padding: 8px 12px;
    }
    .sidebar-nav {
        display: flex; gap: 2px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .sidebar-nav li { margin-bottom: 0; flex-shrink: 0; }
    .sidebar-nav a { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
    .main-content { padding: 16px; }

    /* Fix all grids */
    .grid-2, .grid-3, .grid-auto, .grid-4-plans { grid-template-columns: 1fr; }

    /* Container fix - ensure padding prevents text cut-off */
    .container { padding: 0 20px; }

    /* Hero */
    .hero-section { padding: 90px 0 36px; }
    .hero-title { font-size: 30px; letter-spacing: -0.5px; margin-bottom: 14px; }
    .hero-desc { font-size: 15px; margin-bottom: 28px; }
    .hero-badge-pill { font-size: 12px; padding: 5px 14px; margin-bottom: 16px; }
    .hero-cta { flex-direction: column; align-items: stretch; gap: 12px; width: 100%; margin-bottom: 36px; }
    .hero-cta a { width: 100%; text-align: center; padding: 14px 20px; }

    /* Showcase card */
    .hero-showcase { border-radius: 16px; padding: 8px; max-width: 100%; }
    .showcase-img-container { height: auto; min-height: 260px; padding: 20px 12px; }
    .showcase-preview-card { width: 100%; max-width: 100%; padding: 20px 16px; margin: 0 auto; }
    .showcase-badge-floating {
        position: relative;
        bottom: auto; right: auto;
        margin: 12px auto 0;
        display: inline-flex;
        max-width: 100%;
        font-size: 12px;
    }

    /* Stats - fix the cut-off 4th stat with 2x2 grid */
    .stats-section { padding: 28px 0; }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 16px;
    }
    .stat-number { font-size: 26px; letter-spacing: -0.5px; white-space: nowrap; }
    .stat-label { font-size: 12px; }

    /* Sections */
    .features-section, .steps-section, .pricing-section, .faq-section { padding: 48px 0; }
    .section-header { margin-bottom: 32px; }
    .section-title { font-size: 24px; letter-spacing: -0.3px; }
    .section-desc { font-size: 14px; }

    /* Pricing */
    .pricing-card { padding: 24px 18px; margin-bottom: 0; }
    .pricing-card.featured { transform: none; }

    /* CTA Banner */
    .cta-banner-section { padding: 40px 0; }
    .cta-banner-card { padding: 36px 20px; border-radius: 20px; }
    .cta-title { font-size: 24px; margin-bottom: 12px; }
    .cta-desc { font-size: 14px; margin-bottom: 24px; }
    .btn-cta-white { width: 100%; text-align: center; display: block; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 28px; margin-bottom: 32px; }
    .footer-brand p { max-width: 100%; }
    .footer-bottom { flex-direction: column; text-align: center; gap: 10px; }

    /* Auth */
    .auth-card { padding: 28px 20px; margin: 0 auto; max-width: 100%; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-title { font-size: 26px; line-height: 1.2; }
    .hero-desc { font-size: 14px; }
    .hero-badge-pill { font-size: 11px; padding: 4px 10px; }
    .showcase-preview-card h3 { font-size: 17px !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
    .stat-number { font-size: 22px; }
    .stat-label { font-size: 11px; }
    .section-title { font-size: 21px; }
    .feature-card, .step-card { padding: 20px 16px; }
    .faq-question { padding: 16px; font-size: 14px; }
    .faq-answer { font-size: 13px; }
    .card { padding: 16px; }
    .pricing-card { padding: 20px 14px; }
}

@media (max-width: 360px) {
    .container { padding: 0 14px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 14px 10px; }
    .stat-number { font-size: 20px; }
    .hero-title { font-size: 22px; }
    .section-title { font-size: 19px; }
}

/* ─── Utilities ─── */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 12px; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.table-wrapper { overflow-x: auto; }

/* Mobile Menu & Sidebar Slide-in */
.mobile-only { display: none !important; }

@media (max-width: 768px) {
    .mobile-only { display: block !important; }
    .desktop-only { display: none !important; }
    
    .sidebar {
        position: fixed !important;
        top: 60px !important;
        left: -100% !important;
        width: 250px !important;
        height: calc(100vh - 60px) !important;
        background: var(--surface) !important;
        z-index: 1000 !important;
        transition: left 0.3s ease !important;
        box-shadow: 10px 0 30px rgba(0,0,0,0.1) !important;
        border-right: 1px solid var(--border) !important;
        border-bottom: none !important;
    }
    
    .sidebar.show-mobile {
        left: 0 !important;
    }
    
    .sidebar-nav {
        display: flex !important;
        flex-direction: column !important;
        overflow-x: hidden !important;
    }
    
    .dashboard-layout {
        position: relative;
    }
}
