/* ── Wauto SaaS – Blue/Yellow/White Theme ──────────────────────── */

:root {
    --blue-50: #eff6ff;
    --blue-100: #dbeafe;
    --blue-200: #bfdbfe;
    --blue-400: #60a5fa;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;
    --yellow-300: #fde047;
    --yellow-400: #facc15;
    --yellow-500: #eab308;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--gray-800);
    background: #fff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ───────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }

.btn-accent { background: var(--yellow-400); color: var(--gray-900); }
.btn-accent:hover { background: var(--yellow-500); }

.btn-outline { background: transparent; border: 2px solid var(--blue-600); color: var(--blue-600); }
.btn-outline:hover { background: var(--blue-50); }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 17px; }

/* ── Navigation ────────────────────────────────────────────────── */

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--blue-600);
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-brand span { color: var(--yellow-500); }

.navbar-links { display: flex; align-items: center; gap: 24px; }
.navbar-links a { color: var(--gray-600); font-weight: 500; font-size: 15px; }
.navbar-links a:hover { color: var(--blue-600); text-decoration: none; }

.navbar-actions { display: flex; align-items: center; gap: 12px; }

/* ── Hero ──────────────────────────────────────────────────────── */

.hero {
    padding: 80px 32px;
    text-align: center;
    background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-800) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: var(--yellow-400);
    opacity: 0.08;
    border-radius: 50%;
}
.hero h1 {
    font-size: 52px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.1;
}
.hero h1 em { font-style: normal; color: var(--yellow-400); }
.hero p { font-size: 20px; opacity: 0.9; max-width: 560px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Sections ──────────────────────────────────────────────────── */

.section { padding: 80px 32px; max-width: 1100px; margin: 0 auto; }
.section-alt { background: var(--gray-50); }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 36px; font-weight: 700; color: var(--gray-900); margin-bottom: 12px; }
.section-header p { font-size: 18px; color: var(--gray-500); }

/* ── Feature cards ─────────────────────────────────────────────── */

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

.feature-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 32px;
    transition: all 0.2s;
}
.feature-card:hover { border-color: var(--blue-200); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
    background: var(--blue-50);
    color: var(--blue-600);
}
.feature-icon svg { width: 24px; height: 24px; stroke-width: 1.75; }
.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--gray-500); }

/* ── Pricing cards ─────────────────────────────────────────────── */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 960px;
    margin: 0 auto;
}

.pricing-card {
    background: #fff;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    transition: all 0.2s;
}
.pricing-card.featured {
    border-color: var(--blue-600);
    box-shadow: var(--shadow-xl);
    transform: scale(1.03);
}
.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--yellow-400);
    color: var(--gray-900);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.pricing-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.pricing-price { font-size: 40px; font-weight: 800; color: var(--blue-600); margin: 12px 0; }
.pricing-price span { font-size: 16px; font-weight: 400; color: var(--gray-400); }
.pricing-features { list-style: none; margin: 20px 0; }
.pricing-features li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 8px;
}
.pricing-features li::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: var(--blue-600);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

/* ── Forms ─────────────────────────────────────────────────────── */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    padding: 32px;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}
.auth-card h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.auth-card .subtitle { color: var(--gray-500); margin-bottom: 32px; }
.auth-card .logo { font-size: 20px; font-weight: 800; color: var(--blue-600); margin-bottom: 24px; }
.auth-card .logo span { color: var(--yellow-500); }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ── Dashboard layout ──────────────────────────────────────────── */

.dash-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--gray-900);
    color: #fff;
    padding: 24px 0;
    flex-shrink: 0;
}
.sidebar-brand {
    padding: 0 24px 24px;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}
.sidebar-brand span { color: var(--yellow-400); }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--gray-400);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.sidebar-nav a.active { border-left: 3px solid var(--yellow-400); }
.sidebar-nav a .icon { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-nav a .icon svg { width: 20px; height: 20px; stroke-width: 1.75; }

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
    position: absolute;
    bottom: 0;
    width: 260px;
}
.sidebar-footer a { color: var(--gray-500); font-size: 13px; }

.main-content {
    flex: 1;
    padding: 32px;
    background: var(--gray-50);
    overflow-y: auto;
}

.page-header {
    margin-bottom: 32px;
}
.page-header h1 { font-size: 28px; font-weight: 700; }
.page-header p { color: var(--gray-500); }

/* ── Stat cards ────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
}
.stat-card .stat-label { font-size: 13px; color: var(--gray-500); font-weight: 500; }
.stat-card .stat-value { font-size: 32px; font-weight: 700; color: var(--gray-900); margin: 4px 0; }
.stat-card .stat-sub { font-size: 12px; color: var(--gray-400); }
.stat-card.highlight { border-color: var(--blue-200); background: var(--blue-50); }
.stat-card.highlight .stat-value { color: var(--blue-600); }

/* ── Tables ────────────────────────────────────────────────────── */

.card {
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header h2 { font-size: 18px; font-weight: 600; }

table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
}
th { color: var(--gray-500); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
td { color: var(--gray-700); }

/* ── Badges ────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.badge-active { background: #dcfce7; color: #15803d; }
.badge-revoked { background: #fee2e2; color: #b91c1c; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-free { background: var(--gray-100); color: var(--gray-600); }
.badge-starter { background: var(--blue-100); color: var(--blue-700); }
.badge-pro { background: #fef3c7; color: #92400e; }

/* ── Key display ───────────────────────────────────────────────── */

.key-display {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    background: var(--gray-50);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    cursor: pointer;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.key-display:hover { background: var(--blue-50); }

/* ── Code block ────────────────────────────────────────────────── */

.code-block {
    background: var(--gray-900);
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.7;
    margin: 16px 0;
}
.code-block .keyword { color: #c084fc; }
.code-block .string { color: #34d399; }
.code-block .comment { color: #64748b; }
.code-block .url { color: #60a5fa; }

/* ── Modal ─────────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}
.modal h2 { font-size: 22px; font-weight: 700; margin-bottom: 16px; }

/* ── Footer ────────────────────────────────────────────────────── */

.footer {
    padding: 40px 32px;
    text-align: center;
    background: var(--gray-900);
    color: var(--gray-400);
    font-size: 14px;
}
.footer a { color: var(--gray-300); }

/* ── Responsive ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 16px; }
    .navbar { padding: 12px 16px; }
    .navbar-links { display: none; }
    .section { padding: 48px 16px; }
    .sidebar { display: none; }
    .main-content { padding: 16px; }
}

/* ── Toast ─────────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--gray-900);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
}
.toast.success { border-left: 4px solid #22c55e; }
.toast.error { border-left: 4px solid #ef4444; }

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

/* ── Docs ──────────────────────────────────────────────────────── */

.docs-layout {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}
.docs-sidebar {
    width: 220px;
    padding: 32px 0;
    flex-shrink: 0;
    position: sticky;
    top: 60px;
    align-self: flex-start;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
}
.docs-sidebar a {
    display: block;
    padding: 6px 16px;
    font-size: 14px;
    color: var(--gray-500);
    border-left: 2px solid transparent;
    text-decoration: none;
}
.docs-sidebar a:hover, .docs-sidebar a.active { color: var(--blue-600); border-color: var(--blue-600); }
.docs-content { flex: 1; padding: 32px 0 32px 48px; min-width: 0; }
.docs-content h2 { font-size: 24px; margin: 40px 0 16px; padding-top: 16px; border-top: 1px solid var(--gray-200); }
.docs-content h2:first-child { border-top: none; margin-top: 0; }
.docs-content h3 { font-size: 18px; margin: 24px 0 8px; }
.docs-content p { margin-bottom: 16px; color: var(--gray-600); }

.endpoint-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    font-family: monospace;
    margin-right: 8px;
}
.endpoint-badge.get { background: #dbeafe; color: #1d4ed8; }
.endpoint-badge.post { background: #dcfce7; color: #15803d; }
.endpoint-badge.put { background: #fef3c7; color: #92400e; }
.endpoint-badge.delete { background: #fee2e2; color: #b91c1c; }
