.loader {
    border-top-color: #4f46e5;
    animation: spinner 1s linear infinite;
}

@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pdf-page-break {
    page-break-inside: avoid;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

input[type="url"],
input[type="text"],
input[type="password"],
input[type="email"],
input[type="checkbox"] {
    @apply dark:bg-slate-700 dark:border-slate-600 dark:text-white dark:placeholder-slate-400;
}

/* AI/Markdown content */
.ai-content pre {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.ai-content code {
    font-family: monospace;
    font-size: 0.85em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ===================================================
   LANDING PAGE — THEME-AWARE DESIGN SYSTEM
   =================================================== */

/* Score gauge animation */
@keyframes drawScore {
    from { stroke-dashoffset: 251; }
    to   { stroke-dashoffset: 33;  }
}
.score-ring-anim {
    animation: drawScore 1.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

/* --- HERO --- */
.hero-dark {
    background: #f0f9ff;
    position: relative;
    overflow: hidden;
}
.dark .hero-dark { background: #060D1F; }

.hero-dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(8,145,178,0.14) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    z-index: 0;
}
.dark .hero-dot-grid {
    background-image: radial-gradient(circle, rgba(6,182,212,0.18) 1px, transparent 1px);
}

.hero-glow-top {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(8,145,178,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.dark .hero-glow-top {
    background: radial-gradient(ellipse, rgba(6,182,212,0.1) 0%, transparent 70%);
}

.orb-left {
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.dark .orb-left {
    background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
}

/* Gradient headline text */
.text-gradient-cyan {
    background: linear-gradient(135deg, #0891b2 0%, #0284c7 45%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.dark .text-gradient-cyan {
    background: linear-gradient(135deg, #67e8f9 0%, #38bdf8 45%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Feature chips */
.feature-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 9999px;
    border: 1px solid rgba(8,145,178,0.3);
    background: rgba(8,145,178,0.06);
    color: #334155;
    font-size: 0.875rem;
    font-weight: 600;
    gap: 8px;
    transition: all 0.2s;
}
.feature-chip:hover {
    border-color: rgba(8,145,178,0.5);
    color: #0f172a;
    background: rgba(8,145,178,0.1);
}
.dark .feature-chip {
    border-color: rgba(6,182,212,0.25);
    background: rgba(6,182,212,0.06);
    color: #94a3b8;
}
.dark .feature-chip:hover {
    border-color: rgba(6,182,212,0.5);
    color: #e2e8f0;
    background: rgba(6,182,212,0.1);
}

/* Glow badge */
.glow-badge {
    background: rgba(8,145,178,0.08);
    border: 1px solid rgba(8,145,178,0.3);
    color: #0891b2;
}
.dark .glow-badge {
    background: rgba(6,182,212,0.1);
    border-color: rgba(6,182,212,0.35);
    color: #67e8f9;
}

/* Stats */
.stat-num {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0891b2;
    line-height: 1;
}
.dark .stat-num { color: #06b6d4; }
.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-top: 2px;
}
.dark .stat-label { color: #475569; }

/* Login card */
.login-glass {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 60px rgba(8,145,178,0.08), 0 4px 16px rgba(0,0,0,0.05);
}
.dark .login-glass {
    background: rgba(8,16,35,0.9);
    border-color: rgba(6,182,212,0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: none;
}
.login-glass input {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    color: #0f172a !important;
}
.login-glass input::placeholder { color: #94a3b8 !important; }
.dark .login-glass input {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(6,182,212,0.2) !important;
    color: #e2e8f0 !important;
}
.dark .login-glass input::placeholder { color: #475569 !important; }
.dark .login-glass input:focus { border-color: rgba(6,182,212,0.5) !important; }

/* Google sign-in button (inside login card) */
.login-google-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    transition: background 0.2s;
}
.login-google-btn:hover { background: #f1f5f9; }
.dark .login-google-btn {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: #e2e8f0;
}
.dark .login-google-btn:hover { background: rgba(255,255,255,0.09); }

/* Divider inside login card */
.login-divider-line {
    height: 1px;
    background: #e2e8f0;
    flex-grow: 1;
}
.dark .login-divider-line { background: rgba(255,255,255,0.07); }

/* Register button */
.login-register-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    transition: background 0.2s;
}
.login-register-btn:hover { background: #e2e8f0; }
.dark .login-register-btn {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.1);
    color: #94a3b8;
}
.dark .login-register-btn:hover { background: rgba(255,255,255,0.1); }

/* CTA glow button */
.btn-glow {
    background: linear-gradient(135deg, #06b6d4, #4f46e5);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(6,182,212,0.25);
}
.btn-glow:hover {
    box-shadow: 0 8px 30px rgba(6,182,212,0.45);
    transform: translateY(-1px);
}

/* Section divider */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(8,145,178,0.3), transparent);
}
.dark .section-divider {
    background: linear-gradient(90deg, transparent, rgba(6,182,212,0.3), transparent);
}

/* --- WHY SECTION --- */
.why-dark { background: #f0f9ff; }
.dark .why-dark { background: #030A17; }

.why-card {
    background: #ffffff;
    border: 1px solid rgba(8,145,178,0.12);
    transition: all 0.3s ease;
    border-radius: 1rem;
}
.dark .why-card {
    background: rgba(6,182,212,0.03);
    border-color: rgba(6,182,212,0.1);
}
.why-card:hover {
    border-color: rgba(8,145,178,0.4);
    background: #f0f9ff;
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(8,145,178,0.1);
}
.dark .why-card:hover {
    border-color: rgba(6,182,212,0.35);
    background: rgba(6,182,212,0.07);
    box-shadow: 0 20px 40px -10px rgba(6,182,212,0.12);
}

.why-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    border: 1px solid rgba(8,145,178,0.2);
    background: rgba(8,145,178,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0891b2;
    flex-shrink: 0;
    margin-bottom: 1rem;
}
.dark .why-icon-wrap {
    border-color: rgba(6,182,212,0.2);
    background: rgba(6,182,212,0.08);
    color: #06b6d4;
}

/* --- LEGISLATIONS SECTION --- */
.legis-dark { background: #f8fafc; }
.dark .legis-dark { background: #040C1A; }

.legis-card-dark {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
.dark .legis-card-dark {
    background: rgba(8,16,35,0.9);
    border-color: rgba(6,182,212,0.15);
}

/* --- PRICING SECTION --- */
.pricing-dark { background: #f0f9ff; }
.dark .pricing-dark { background: #030A17; }

.plan-card-dark {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    border-radius: 1rem;
}
.dark .plan-card-dark {
    background: rgba(6,182,212,0.03);
    border-color: rgba(6,182,212,0.12);
}
.plan-card-dark:hover {
    border-color: rgba(8,145,178,0.4);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(8,145,178,0.08);
}
.dark .plan-card-dark:hover {
    border-color: rgba(6,182,212,0.3);
    box-shadow: none;
}

.plan-card-pro {
    background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
    border: 1px solid rgba(8,145,178,0.4);
    box-shadow: 0 0 50px -15px rgba(8,145,178,0.2), 0 4px 20px rgba(8,145,178,0.08);
    border-radius: 1rem;
}
.dark .plan-card-pro {
    background: linear-gradient(135deg, rgba(6,182,212,0.1) 0%, rgba(99,102,241,0.08) 100%);
    border-color: rgba(6,182,212,0.4);
    box-shadow: 0 0 50px -15px rgba(6,182,212,0.25), 0 0 0 1px rgba(6,182,212,0.1);
}

/* --- FOOTER --- */
.footer-dark {
    background: #f0f9ff;
    border-top: 1px solid rgba(8,145,178,0.15);
}
.dark .footer-dark {
    background: #020910;
    border-top-color: rgba(6,182,212,0.1);
}

/* ===================================================
   APP-WIDE INTERNAL VIEWS — DESIGN SYSTEM
   =================================================== */

/* Back navigation links */
.back-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0891b2;
    transition: color 0.15s, gap 0.15s;
    gap: 4px;
    margin-bottom: 1rem;
    text-decoration: none;
}
.back-link:hover { color: #0e7490; gap: 6px; }
.dark .back-link { color: #22d3ee; }
.dark .back-link:hover { color: #67e8f9; }

/* Primary action button */
.app-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0891b2, #005A9C);
    color: #ffffff;
    font-weight: 700;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(8,145,178,0.25);
    border: none;
}
.app-btn-primary:hover {
    box-shadow: 0 4px 16px rgba(8,145,178,0.4);
    transform: translateY(-1px);
}
.app-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary / ghost button */
.app-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}
.app-btn-secondary:hover { background: #e2e8f0; }
.dark .app-btn-secondary {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}
.dark .app-btn-secondary:hover { background: #293548; }

/* App card */
.app-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.app-card:hover {
    border-color: rgba(8,145,178,0.3);
    box-shadow: 0 4px 16px rgba(8,145,178,0.07);
}
.dark .app-card {
    background: #0f172a;
    border-color: rgba(6,182,212,0.1);
}
.dark .app-card:hover {
    border-color: rgba(6,182,212,0.3);
    box-shadow: 0 4px 16px rgba(6,182,212,0.08);
}

/* Improve dark mode borders on ALL view cards */
.dark .view-section .shadow,
.dark .view-section .shadow-sm,
.dark .view-section .shadow-md,
.dark .view-section .shadow-xl {
    box-shadow: none;
}

/* Status badges */
.badge-pro {
    background: linear-gradient(135deg, #0891b2, #4f46e5);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Score circle in reports */
.score-circle-excellent { border-color: #22c55e; color: #22c55e; }
.score-circle-good      { border-color: #84cc16; color: #84cc16; }
.score-circle-fair      { border-color: #f59e0b; color: #f59e0b; }
.score-circle-poor      { border-color: #ef4444; color: #ef4444; }

/* Improve input styles globally */
input[type="url"]:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #0891b2 !important;
    box-shadow: 0 0 0 3px rgba(8,145,178,0.12);
}
.dark input[type="url"]:focus,
.dark input[type="text"]:focus,
.dark input[type="password"]:focus,
.dark input[type="email"]:focus {
    border-color: #06b6d4 !important;
    box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
}

/* Resource/static pages card */
.content-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 4px 24px rgba(8,145,178,0.06);
}
.dark .content-card {
    background: #0f172a;
    border-color: rgba(6,182,212,0.12);
    box-shadow: none;
}

/* Navbar improvements */
.dark nav {
    border-bottom-color: rgba(6,182,212,0.1) !important;
}
