/*
 * Recrugent Shared Design System
 * ──────────────────────────────
 * Extracted from the homepage (index.html) to provide a single source of truth
 * for colors, typography, spacing, and component styles across all pages.
 *
 * DO NOT duplicate these styles in individual page files.
 * All pages except index.html and demo.html should link this file.
 */

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

/* ── Design Tokens ──────────────────────────────────────────────────────────── */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-card-hover: #181824;
    --accent: #6c5ce7;
    --accent-light: #a29bfe;
    --accent-dim: rgba(108, 92, 231, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --border: #1e1e2e;
    --border-hover: #2e2e42;
    --gradient-start: #6c5ce7;
    --gradient-end: #00cec9;
    --success: #00b894;
    --success-bg: rgba(0, 184, 148, 0.12);
    --warning: #fdcb6e;
    --warning-bg: rgba(253, 203, 110, 0.12);
    --danger: #ff6b6b;
    --danger-bg: rgba(255, 107, 107, 0.12);
    --info: #74b9ff;
    --info-bg: rgba(116, 185, 255, 0.12);
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
}

a { color: inherit; text-decoration: none; }

/* ── Glow Orbs (background ambiance) ────────────────────────────────────────── */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}
.glow-orb.purple { width: 600px; height: 600px; background: var(--accent); top: -200px; right: -100px; }
.glow-orb.teal { width: 500px; height: 500px; background: var(--gradient-end); bottom: 20%; left: -150px; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

main {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* ── Nav ────────────────────────────────────────────────────────────────────── */
nav {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(10, 10, 15, 0.93);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

/* Shared nav needs position:relative for mobile menu dropdown */
nav.shared-nav {
    position: sticky;
    top: 0;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    cursor: pointer;
    text-decoration: none;
}

.logo span {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover { color: var(--text-primary); background: var(--accent-dim); }
.nav-link.active, .nav-link-active {
    color: var(--accent-light);
    background: var(--accent-dim);
}

/* Active nav item: visible but not clickable */
.nav-link-active {
    cursor: default;
    font-weight: 600;
    pointer-events: none;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-user-email {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.nav-auth-link {
    font-size: 0.85rem;
    color: var(--accent-light);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-auth-link:hover {
    background: var(--accent-dim);
    color: var(--text-primary);
}

/* Dashboard CTA link in marketing mode */
.nav-link-cta {
    font-weight: 600;
    color: var(--accent-light);
}

/* Upgrade link (logged in, no plan) */
.nav-link-upgrade {
    color: var(--success);
    font-weight: 600;
}
.nav-link-upgrade:hover {
    color: var(--text-primary);
    background: var(--success-bg);
}

/* Active plan name in nav */
.nav-link-plan {
    color: var(--accent-light);
    font-weight: 500;
    border: 1px solid rgba(108, 92, 231, 0.25);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.82rem;
}
.nav-link-plan:hover {
    background: var(--accent-dim);
    border-color: rgba(108, 92, 231, 0.4);
}

/* CTA button in nav */
.nav-cta-btn {
    white-space: nowrap;
}

/* ── Language Toggle ────────────────────────────────────────────────────── */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    margin-left: 4px;
}
.lang-btn {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.15s;
    line-height: 1;
}
.lang-btn:hover { color: var(--text-secondary); }
.lang-btn.active {
    background: var(--accent-dim);
    color: var(--accent-light);
    cursor: default;
}

/* Mobile: lang toggle + hamburger grouped on right */
.nav-right-mobile {
    display: none;
    align-items: center;
    gap: 8px;
}

/* Desktop: show inline lang toggle in nav-links, hide mobile group */
.lang-toggle-desktop { display: inline-flex; }
.lang-toggle-mobile { display: none; }

/* Test account badge */
.nav-test-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 99px;
    vertical-align: middle;
    margin-left: 4px;
}

/* ── Hamburger Menu ──────────────────────────────────────────────────────── */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s;
    z-index: 91;
}
.nav-hamburger:hover { background: var(--accent-dim); }

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.25s ease;
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile menu overlay */
.nav-mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    z-index: 89;
}
.nav-mobile-menu.open { display: flex; }

.nav-mobile-menu .nav-link,
.nav-mobile-menu .nav-link-active,
.nav-mobile-menu .nav-auth-link,
.nav-mobile-menu .nav-link-upgrade,
.nav-mobile-menu .nav-link-plan,
.nav-mobile-menu .nav-link-cta {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    text-align: left;
}

.nav-mobile-menu .nav-user-email {
    display: block;
    padding: 10px 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.nav-mobile-menu .nav-cta-btn {
    display: block;
    text-align: center;
    margin: 8px 0;
}

.nav-mobile-menu .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }

.btn-ghost {
    background: none;
    color: var(--text-secondary);
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.2);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.2); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }

.btn-full { width: 100%; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    transition: border-color 0.2s;
}

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

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

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-required {
    color: var(--danger);
    margin-left: 2px;
}

/* ── Alerts ─────────────────────────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(0, 184, 148, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(253, 203, 110, 0.2);
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(116, 185, 255, 0.2);
}

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    max-width: 360px;
    z-index: 100;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transform: translateY(0);
    opacity: 1;
    transition: all 0.3s;
}

.toast.hidden {
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--accent); }

/* ── Status Badges ──────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-muted {
    background: rgba(136, 136, 160, 0.12);
    color: var(--text-secondary);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-dot-green { background: var(--success); }
.badge-dot-gray { background: var(--text-muted); }

/* ── Spinner ────────────────────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

.spinner-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.spinner-accent {
    border-color: var(--accent-dim);
    border-top-color: var(--accent-light);
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.site-footer {
    margin-top: auto;
    padding: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.site-footer a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-footer a:hover { color: var(--text-primary); }

/* ── Utility: Loading overlay ───────────────────────────────────────────────── */
.loading-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 0;
}

/* ── Utility: Text styles ───────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.text-center { text-align: center; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nav-links-desktop { display: none !important; }
    .nav-right-mobile { display: flex; }
    .nav-hamburger { display: flex; }
    .lang-toggle-mobile { display: inline-flex; }

    /* Hide inline lang-bar on pages that still have it (missie, over) */
    .lang-bar { display: none; }
}

@media (max-width: 640px) {
    nav { padding: 12px 16px; }
    .container { padding: 0 16px; }
    .card { padding: 16px; }
}

/* ── Nav mobile menu: lang toggle full width ───────────────────────────────── */
.nav-mobile-menu .lang-toggle {
    margin: 8px 0;
    justify-content: center;
}
