/* ============================================
   BB Docs SaaS - Stylesheet
   BinaryBridge Inc.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bb-dark: #0f0f1a;
    --bb-darker: #0a0a14;
    --bb-navy: #1a1a2e;
    --bb-red: #C62828;
    --bb-red-light: #E53935;
    --bb-red-dark: #a11f1f;
    --bb-slate: #8892b0;
    --bb-light: #ccd6f6;
    --bb-white: #e6f1ff;
    --bb-surface: #161625;
    --bb-surface-2: #1e1e32;
    --bb-border: #2a2a40;
    --bb-success: #22c55e;
    --bb-warning: #f59e0b;
    --bb-error: #ef4444;
    --bb-info: #3b82f6;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --transition: all 0.3s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    background: var(--bb-dark);
    color: var(--bb-light);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--bb-red-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--bb-red); }

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

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow { max-width: 680px; margin: 0 auto; padding: 0 24px; }

.section {
    padding: 100px 0;
}

.section-sm { padding: 60px 0; }

.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .section { padding: 60px 0; }
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(15, 15, 26, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bb-border);
    transition: var(--transition);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--bb-red);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.logo span { color: var(--bb-red-light); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--bb-slate);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-links a:hover { color: #fff; }

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

/* Mobile menu */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--bb-light);
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .nav-links, .nav-actions { display: none; }
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 72px; left: 0; right: 0;
        background: var(--bb-navy);
        padding: 20px;
        border-bottom: 1px solid var(--bb-border);
    }
    .nav-actions.active {
        display: flex;
        position: absolute;
        top: auto;
        left: 0; right: 0;
        background: var(--bb-navy);
        padding: 0 20px 20px;
        justify-content: center;
    }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--bb-red);
    color: #fff;
}
.btn-primary:hover {
    background: var(--bb-red-light);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--bb-light);
    border: 1px solid var(--bb-border);
}
.btn-secondary:hover {
    border-color: var(--bb-red-light);
    color: #fff;
    background: rgba(198, 40, 40, 0.1);
}

.btn-ghost {
    background: transparent;
    color: var(--bb-light);
    padding: 10px 20px;
}
.btn-ghost:hover { color: #fff; }

.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-full { width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 72px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(198, 40, 40, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(198, 40, 40, 0.15);
    border: 1px solid rgba(198, 40, 40, 0.3);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    color: var(--bb-red-light);
    margin-bottom: 28px;
    font-weight: 500;
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.2rem);
    font-weight: 700;
    line-height: 1.15;
    color: #fff;
    margin-bottom: 24px;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--bb-red-light), #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--bb-slate);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--bb-border);
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--bb-slate);
    margin-top: 4px;
}

/* ============================================
   SECTION HEADINGS
   ============================================ */
.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 64px;
}

.section-header .tag {
    display: inline-block;
    color: var(--bb-red-light);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.2;
}

.section-header p {
    color: var(--bb-slate);
    font-size: 1.1rem;
}

/* ============================================
   FEATURE CARDS
   ============================================ */
.feature-card {
    background: var(--bb-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    transition: var(--transition);
}

.feature-card:hover {
    border-color: rgba(198, 40, 40, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 52px;
    height: 52px;
    background: rgba(198, 40, 40, 0.12);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--bb-slate);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================
   PRICING
   ============================================ */
.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
}

.pricing-toggle span {
    font-size: 0.95rem;
    color: var(--bb-slate);
    font-weight: 500;
}

.pricing-toggle span.active { color: #fff; }

.toggle-switch {
    width: 56px;
    height: 30px;
    background: var(--bb-surface-2);
    border-radius: 100px;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--bb-border);
    transition: var(--transition);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: var(--bb-red);
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch.yearly::after {
    transform: translateX(26px);
}

.pricing-save {
    background: rgba(34, 197, 94, 0.15);
    color: var(--bb-success);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    align-items: start;
}

@media (max-width: 1024px) {
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.pricing-card {
    background: var(--bb-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--radius-lg);
    padding: 36px;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    border-color: rgba(198, 40, 40, 0.3);
    transform: translateY(-4px);
}

.pricing-card.featured {
    border-color: var(--bb-red);
    background: linear-gradient(180deg, rgba(198, 40, 40, 0.08) 0%, var(--bb-surface) 100%);
}

.pricing-card.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bb-red);
    color: #fff;
    padding: 4px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

.pricing-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.pricing-card .plan-desc {
    color: var(--bb-slate);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
}

.price-amount {
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
}

.price-period {
    color: var(--bb-slate);
    font-size: 0.9rem;
}

.price-yearly {
    color: var(--bb-slate);
    font-size: 0.85rem;
    margin-bottom: 28px;
}

.pricing-features {
    list-style: none;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pricing-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--bb-light);
}

.pricing-features li::before {
    content: '✓';
    color: var(--bb-success);
    font-weight: 700;
    flex-shrink: 0;
}

.pricing-features li.disabled {
    color: var(--bb-slate);
    opacity: 0.5;
}

.pricing-features li.disabled::before {
    content: '—';
    color: var(--bb-slate);
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonial-card {
    background: var(--bb-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.testimonial-text {
    font-size: 1rem;
    color: var(--bb-light);
    line-height: 1.8;
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-avatar {
    width: 44px;
    height: 44px;
    background: var(--bb-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
}

.testimonial-name { color: #fff; font-weight: 600; }
.testimonial-title { color: var(--bb-slate); font-size: 0.85rem; }

/* ============================================
   FAQ
   ============================================ */
.faq-item {
    border: 1px solid var(--bb-border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 20px 24px;
    background: var(--bb-surface);
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition);
}

.faq-question:hover { background: var(--bb-surface-2); }

.faq-question .icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
    color: var(--bb-slate);
}

.faq-item.active .faq-question .icon {
    transform: rotate(45deg);
    color: var(--bb-red-light);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer-inner {
    padding: 0 24px 20px;
    color: var(--bb-slate);
    line-height: 1.8;
}

.faq-item.active .faq-answer {
    max-height: 300px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--bb-darker);
    border-top: 1px solid var(--bb-border);
    padding: 60px 0 30px;
}

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

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

.footer-brand p {
    color: var(--bb-slate);
    margin-top: 12px;
    font-size: 0.9rem;
    max-width: 300px;
}

.footer-col h4 {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.footer-col ul { list-style: none; }

.footer-col ul li { margin-bottom: 10px; }

.footer-col ul a {
    color: var(--bb-slate);
    font-size: 0.9rem;
}

.footer-col ul a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid var(--bb-border);
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--bb-slate);
}

@media (max-width: 640px) {
    .footer-bottom { flex-direction: column; gap: 12px; }
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
    background: linear-gradient(135deg, rgba(198, 40, 40, 0.15) 0%, var(--bb-dark) 100%);
    border-top: 1px solid rgba(198, 40, 40, 0.2);
    border-bottom: 1px solid rgba(198, 40, 40, 0.2);
    text-align: center;
}

.cta-section h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.cta-section p {
    color: var(--bb-slate);
    font-size: 1.1rem;
    max-width: 550px;
    margin: 0 auto 32px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    color: var(--bb-light);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bb-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--radius);
    color: var(--bb-light);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--bb-red-light);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.15);
}

.form-input::placeholder { color: var(--bb-slate); }

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

.form-hint {
    font-size: 0.82rem;
    color: var(--bb-slate);
    margin-top: 6px;
}

.form-error {
    font-size: 0.82rem;
    color: var(--bb-error);
    margin-top: 6px;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    background: var(--bb-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-card .logo {
    justify-content: center;
    margin-bottom: 8px;
}

.auth-card h2 {
    text-align: center;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--bb-slate);
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.auth-divider {
    text-align: center;
    color: var(--bb-slate);
    font-size: 0.85rem;
    margin: 20px 0;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--bb-slate);
    font-size: 0.9rem;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 20px;
    border: 1px solid;
}

.alert-success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: var(--bb-success); }
.alert-error   { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: var(--bb-error); }
.alert-warning { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: var(--bb-warning); }
.alert-info    { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: var(--bb-info); }

/* ============================================
   PORTAL / DASHBOARD
   ============================================ */
.portal-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 72px;
}

.portal-sidebar {
    width: 260px;
    background: var(--bb-surface);
    border-right: 1px solid var(--bb-border);
    padding: 24px 0;
    position: fixed;
    top: 72px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.portal-sidebar-nav { list-style: none; }

.portal-sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--bb-slate);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
}

.portal-sidebar-nav li a:hover,
.portal-sidebar-nav li a.active {
    background: rgba(198, 40, 40, 0.1);
    color: var(--bb-red-light);
    border-right: 3px solid var(--bb-red);
}

.portal-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
}

@media (max-width: 768px) {
    .portal-sidebar { display: none; }
    .portal-main { margin-left: 0; }
}

/* Dashboard cards */
.dash-card {
    background: var(--bb-surface);
    border: 1px solid var(--bb-border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.dash-card h3 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bb-slate);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.dash-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.dash-card .subtext {
    font-size: 0.85rem;
    color: var(--bb-slate);
    margin-top: 4px;
}

/* ============================================
   TABLES
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--bb-slate);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--bb-border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--bb-light);
    border-bottom: 1px solid var(--bb-border);
}

.data-table tr:hover td {
    background: var(--bb-surface-2);
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-success { background: rgba(34,197,94,0.15); color: var(--bb-success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--bb-warning); }
.badge-error   { background: rgba(239,68,68,0.15); color: var(--bb-error); }
.badge-info    { background: rgba(59,130,246,0.15); color: var(--bb-info); }

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--bb-slate); }
.text-success { color: var(--bb-success); }
.text-error { color: var(--bb-error); }
.text-white { color: #fff; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
