/* ===== CSS VARIABLES / DESIGN TOKENS ===== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --bg-glass-strong: rgba(255, 255, 255, 0.1);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-primary-glow: rgba(99, 102, 241, 0.25);
    --accent-secondary: #f59e0b;
    --accent-success: #10b981;
    --accent-danger: #ef4444;

    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #312e81 100%);
    --gradient-accent: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-cta: linear-gradient(135deg, #312e81 0%, #4f46e5 50%, #6366f1 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #10b981 100%);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}
.btn-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 4px 15px var(--accent-primary-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--accent-primary-glow); }
.btn-accent { background: var(--accent-primary); color: white; border-radius: var(--radius-sm); }
.btn-accent:hover { background: var(--accent-primary-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-medium); }
.btn-ghost:hover { background: var(--bg-glass); color: var(--text-primary); }
.btn-success { background: var(--gradient-success); color: white; }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3); }
.btn-light { background: white; color: var(--accent-primary); }
.btn-light:hover { background: #f1f5f9; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; justify-content: center; padding: 12px; }
.btn-icon {
    width: 36px; height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    color: var(--text-secondary); cursor: pointer;
    transition: all var(--transition-normal); font-size: 0.85rem;
}
.btn-icon:hover { background: var(--bg-glass-strong); color: var(--text-primary); border-color: var(--accent-primary); }

/* ===== NAVBAR ===== */
#navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
    max-width: 1280px; margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.4rem; font-weight: 800; color: var(--text-primary);
    transition: opacity var(--transition-fast);
}
.logo i { color: var(--accent-primary); font-size: 1.3rem; }
.logo:hover { opacity: 0.85; }
.nav-links { display: flex; gap: 32px; }
.nav-link {
    font-size: 0.9rem; font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast); position: relative;
}
.nav-link::after {
    content: ''; position: absolute; bottom: -4px; left: 0;
    width: 0; height: 2px;
    background: var(--accent-primary); border-radius: 2px;
    transition: width var(--transition-normal);
}
.nav-link:hover { color: var(--text-primary); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--accent-primary-hover); }
.nav-link.active::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.hamburger {
    display: none; background: none; border: none;
    color: var(--text-primary); font-size: 1.3rem; cursor: pointer; padding: 8px;
}
.mobile-menu {
    display: none; flex-direction: column; gap: 8px;
    padding: 16px 24px 20px; border-top: 1px solid var(--border-subtle);
}
.mobile-menu.active { display: flex; }

/* ===== USER MENU ===== */
.user-menu-trigger {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; padding: 4px 12px 4px 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
}
.user-menu-trigger:hover { background: var(--bg-glass); border-color: var(--border-medium); }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--gradient-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: white; flex-shrink: 0;
}
.user-avatar-lg {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--gradient-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; color: white; flex-shrink: 0;
}
.user-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.user-chevron { font-size: 0.65rem; color: var(--text-muted); transition: transform var(--transition-fast); }
.user-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: none; overflow: hidden;
    animation: fadeInDown 0.2s ease;
}
.user-dropdown.active { display: block; }
.user-dropdown-header {
    display: flex; align-items: center; gap: 12px;
    padding: 16px;
}
.dropdown-name { font-weight: 700; font-size: 0.9rem; }
.dropdown-email { font-size: 0.78rem; color: var(--text-muted); }
.user-dropdown-divider { height: 1px; background: var(--border-subtle); }
.wallet-info {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; font-size: 0.85rem; color: var(--text-secondary);
}
.wallet-info i { color: var(--accent-secondary); }
.wallet-info strong { color: var(--accent-success); }
.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}
.dropdown-item:hover { background: var(--bg-glass); color: var(--text-primary); }
.dropdown-item i { width: 18px; text-align: center; font-size: 0.85rem; }
.dropdown-item-danger:hover { background: rgba(239, 68, 68, 0.1); color: var(--accent-danger); }

/* ===== HERO ===== */
#hero {
    position: relative; background: var(--gradient-hero);
    padding: 100px 24px 80px; overflow: hidden; text-align: center;
}
.hero-bg-effect {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139, 92, 246, 0.08), transparent);
    pointer-events: none;
}
.hero-content { position: relative; max-width: 800px; margin: 0 auto; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 18px;
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 600; color: var(--accent-primary-hover);
    margin-bottom: 32px; animation: fadeInDown 0.6s ease;
}
.hero-badge i { color: var(--accent-secondary); }
#hero h1 {
    font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 900; line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    animation: fadeInDown 0.6s ease 0.1s both;
}
.hero-subtitle {
    font-size: 1.15rem; color: var(--text-secondary);
    max-width: 600px; margin: 0 auto 40px; line-height: 1.7;
    animation: fadeInDown 0.6s ease 0.2s both;
}
.hero-search {
    display: flex; align-items: center; gap: 8px;
    max-width: 620px; margin: 0 auto 48px;
    padding: 6px 6px 6px 20px;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
    animation: fadeInDown 0.6s ease 0.3s both;
}
.hero-search:focus-within { border-color: var(--accent-primary); box-shadow: 0 0 0 4px var(--accent-primary-glow); }
.search-icon { color: var(--text-muted); font-size: 0.95rem; flex-shrink: 0; }
.hero-search input {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-primary); font-family: var(--font-family); font-size: 0.95rem; padding: 10px 8px;
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-stats {
    display: flex; align-items: center; justify-content: center; gap: 32px;
    animation: fadeInDown 0.6s ease 0.4s both;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-number {
    font-size: 1.8rem; font-weight: 800;
    background: var(--gradient-accent);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label {
    font-size: 0.8rem; color: var(--text-muted); font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.stat-divider { width: 1px; height: 40px; background: var(--border-subtle); }

/* ===== MAIN / DOCUMENTS ===== */
#documents-section {
    max-width: 1280px; margin: 0 auto; padding: 60px 24px 80px;
}
.section-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: 20px; margin-bottom: 40px;
}
.section-header h2 { font-size: 1.8rem; font-weight: 800; }
.section-subtitle { color: var(--text-secondary); font-size: 0.95rem; margin-top: 4px; }
.filter-controls { display: flex; align-items: center; gap: 12px; }
.filter-group { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-group select {
    padding: 8px 14px;
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary); font-family: var(--font-family); font-size: 0.85rem;
    cursor: pointer; transition: all var(--transition-fast); appearance: auto;
}
.filter-group select:hover,
.filter-group select:focus { border-color: var(--accent-primary); color: var(--text-primary); outline: none; }

/* ===== DOCUMENT GRID ===== */
.documents-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px;
}

/* ===== DOCUMENT CARD ===== */
.doc-card {
    position: relative;
    background: var(--bg-card); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden; transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease both;
}
.doc-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}
.doc-card-header {
    position: relative; height: 140px;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.doc-card-header .doc-icon {
    font-size: 3rem; opacity: 0.6; transition: transform var(--transition-normal);
}
.doc-card:hover .doc-icon { transform: scale(1.1); }
.doc-type-badge {
    position: absolute; top: 12px; right: 12px;
    padding: 4px 10px; border-radius: var(--radius-full);
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-summary { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.badge-lecture-notes { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-study-guide { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.badge-exam-prep { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.badge-cheat-sheet { background: rgba(236, 72, 153, 0.2); color: #f9a8d4; }
.badge-other { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

/* Price badge */
.doc-price-badge {
    position: absolute; top: 12px; left: 12px;
    padding: 4px 12px; border-radius: var(--radius-full);
    font-size: 0.75rem; font-weight: 700;
}
.price-free { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.price-paid { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }

.doc-card-body { padding: 20px; }
.doc-card-body h3 {
    font-size: 1rem; font-weight: 700; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4;
}
.doc-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-meta span {
    display: flex; align-items: center; gap: 5px;
    font-size: 0.78rem; color: var(--text-muted);
}
.doc-meta span i { font-size: 0.7rem; color: var(--accent-primary-hover); }
.doc-description {
    font-size: 0.83rem; color: var(--text-secondary); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 16px;
}
.doc-card-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px; border-top: 1px solid var(--border-subtle);
}
.doc-author { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--text-secondary); }
.author-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--gradient-accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: white; flex-shrink: 0;
}
.doc-actions { display: flex; gap: 6px; position: relative; }

/* Card action buttons */
.btn-get {
    padding: 6px 14px; font-size: 0.78rem; font-weight: 600;
    border-radius: var(--radius-sm); border: none; cursor: pointer;
    transition: all var(--transition-fast); font-family: var(--font-family);
    display: inline-flex; align-items: center; gap: 5px;
}
.btn-get-free { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.btn-get-free:hover { background: rgba(16, 185, 129, 0.3); }
.btn-get-buy { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
.btn-get-buy:hover { background: rgba(245, 158, 11, 0.3); }
.btn-get-owned { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; cursor: default; }

.card-bg-pattern {
    position: absolute; inset: 0; opacity: 0.04; pointer-events: none;
}
.pattern-dots {
    background-image: radial-gradient(circle, currentColor 1px, transparent 1px);
    background-size: 16px 16px;
}
.pattern-lines {
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, currentColor 10px, currentColor 11px);
}
.pattern-grid {
    background-image: linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ===== EMPTY + NO RESULTS ===== */
.empty-state, .no-results { text-align: center; padding: 80px 24px; }
.empty-icon {
    width: 80px; height: 80px; margin: 0 auto 24px;
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: var(--text-muted);
}
.empty-state h3, .no-results h3 { font-size: 1.3rem; margin-bottom: 8px; }
.empty-state p, .no-results p { color: var(--text-secondary); margin-bottom: 24px; }

/* ===== LIBRARY PAGE ===== */
.library-page {
    max-width: 1280px; margin: 0 auto; padding: 60px 24px 80px;
}
.library-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 16px; margin-bottom: 40px;
}
.library-header h2 {
    font-size: 1.8rem; font-weight: 800;
    display: flex; align-items: center; gap: 12px;
}
.library-header h2 i { color: var(--accent-primary); }

/* ===== CTA SECTION ===== */
#cta-section { padding: 0 24px 80px; }
.cta-content {
    position: relative; max-width: 900px; margin: 0 auto;
    text-align: center; padding: 80px 40px;
    background: var(--gradient-cta);
    border-radius: var(--radius-xl); overflow: hidden;
}
.cta-glow {
    position: absolute; top: -50%; left: 50%; transform: translateX(-50%);
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}
.cta-content h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 16px; position: relative; }
.cta-content p {
    color: rgba(255, 255, 255, 0.75); font-size: 1.05rem;
    max-width: 500px; margin: 0 auto 32px; position: relative;
}
.cta-content .btn { position: relative; }

/* ===== FOOTER ===== */
#footer { border-top: 1px solid var(--border-subtle); padding: 40px 24px; }
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-brand .logo { font-size: 1.2rem; margin-bottom: 8px; }
.footer-brand p { color: var(--text-muted); font-size: 0.85rem; }
.footer-bottom {
    margin-top: 24px; padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.8rem; color: var(--text-muted);
}

/* ===== MODAL (shared) ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px); z-index: 200;
    display: none; align-items: center; justify-content: center;
    padding: 24px; opacity: 0;
    transition: opacity var(--transition-normal);
}
.modal-overlay.active { display: flex; opacity: 1; }
.modal {
    width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform var(--transition-normal);
}
.modal-sm { max-width: 440px; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 28px; border-bottom: 1px solid var(--border-subtle);
}
.modal-header h2 {
    font-size: 1.2rem; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
}
.modal-header h2 i { color: var(--accent-primary); }
.modal-close {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    color: var(--text-secondary); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--accent-danger); color: white; border-color: var(--accent-danger); }

/* ===== FORM ELEMENTS ===== */
#upload-form, .auth-tab form, #funds-form { padding: 24px 28px; }
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; padding: 10px 14px;
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary); font-family: var(--font-family); font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none; border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group select option { background: var(--bg-secondary); color: var(--text-primary); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Password field */
.password-field { position: relative; }
.password-field input { padding-right: 44px; }
.password-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px; font-size: 0.9rem;
    transition: color var(--transition-fast);
}
.password-toggle:hover { color: var(--text-primary); }

/* Auth error */
.auth-error {
    font-size: 0.82rem; color: var(--accent-danger);
    padding: 0 0 12px; min-height: 8px;
}

/* Auth switch */
.auth-switch {
    text-align: center; margin-top: 16px;
    font-size: 0.85rem; color: var(--text-muted);
}
.auth-switch a { color: var(--accent-primary-hover); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

/* ===== PRICING TOGGLE ===== */
.pricing-toggle {
    display: flex; gap: 8px;
}
.pricing-option {
    flex: 1; padding: 10px 16px;
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary); font-family: var(--font-family);
    font-size: 0.85rem; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all var(--transition-fast);
}
.pricing-option:hover { border-color: var(--border-medium); color: var(--text-primary); }
.pricing-option.active {
    background: var(--accent-primary-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary-hover);
}
.price-input-wrap {
    position: relative;
}
.price-prefix {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-weight: 600;
}
.price-input-wrap input { padding-left: 30px; }

/* ===== DROP ZONE ===== */
.drop-zone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-md); padding: 32px;
    text-align: center; cursor: pointer;
    transition: all var(--transition-normal); margin-bottom: 24px;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent-primary); background: rgba(99, 102, 241, 0.05); }
.drop-zone-content i { font-size: 2.5rem; color: var(--text-muted); margin-bottom: 12px; }
.drop-zone-content p { color: var(--text-secondary); font-size: 0.9rem; }
.drop-zone-content p strong { color: var(--accent-primary-hover); }
.drop-zone-content span { display: block; margin-top: 6px; font-size: 0.75rem; color: var(--text-muted); }
.drop-zone-file { display: flex; align-items: center; gap: 12px; justify-content: center; }
.drop-zone-file i { font-size: 1.4rem; color: var(--accent-success); }
.drop-zone-file span { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; }
.btn-remove-file {
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    color: var(--text-secondary); width: 28px; height: 28px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 0.75rem;
    transition: all var(--transition-fast);
}
.btn-remove-file:hover { background: var(--accent-danger); color: white; border-color: var(--accent-danger); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 8px; }

/* ===== FUNDS MODAL ===== */
.funds-balance {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; background: var(--bg-glass); border-radius: var(--radius-md);
    margin-bottom: 20px; font-size: 0.9rem; color: var(--text-secondary);
}
.funds-balance strong { font-size: 1.3rem; color: var(--accent-success); }
.funds-presets {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px;
}
.funds-preset {
    padding: 10px; text-align: center;
    background: var(--bg-glass); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary); font-family: var(--font-family);
    font-size: 0.9rem; font-weight: 700; cursor: pointer;
    transition: all var(--transition-fast);
}
.funds-preset:hover { border-color: var(--accent-primary); color: var(--accent-primary-hover); background: var(--accent-primary-glow); }

/* ===== PURCHASE MODAL ===== */
.purchase-details { padding: 24px 28px; }
.purchase-doc-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.purchase-doc-author { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px; }
.purchase-price-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; font-size: 0.9rem; color: var(--text-secondary);
}
.purchase-price-row.total { font-size: 1rem; }
.purchase-price-row.total strong { color: var(--accent-success); }
.purchase-divider { height: 1px; background: var(--border-subtle); margin: 8px 0; }
.purchase-error {
    font-size: 0.82rem; color: var(--accent-danger);
    padding: 8px 0; min-height: 8px;
}
.purchase-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }

/* ===== TOAST ===== */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    padding: 14px 24px;
    background: var(--bg-secondary); border: 1px solid var(--accent-success);
    border-radius: var(--radius-md);
    display: flex; align-items: center; gap: 10px;
    font-size: 0.9rem; font-weight: 500; color: var(--accent-success);
    box-shadow: var(--shadow-md); z-index: 300;
    transform: translateY(100px); opacity: 0;
    transition: all var(--transition-normal); pointer-events: none;
}
.toast.active { transform: translateY(0); opacity: 1; pointer-events: auto; }
.toast i { font-size: 1.1rem; }

/* ===== DELETE CONFIRM ===== */
.delete-confirm {
    position: absolute; bottom: 100%; right: 0; margin-bottom: 8px;
    background: var(--bg-secondary); border: 1px solid var(--accent-danger);
    border-radius: var(--radius-sm); padding: 12px 16px;
    box-shadow: var(--shadow-md); z-index: 10; white-space: nowrap;
    animation: fadeInUp 0.2s ease;
}
.delete-confirm p { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 10px; }
.delete-confirm-actions { display: flex; gap: 8px; justify-content: flex-end; }

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

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-medium); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hamburger { display: block; }
    .nav-actions #auth-buttons, .nav-actions #user-menu { display: none !important; }
    .nav-actions .hamburger { display: block; }
    #hero { padding: 60px 16px 50px; }
    .hero-search {
        flex-direction: column; padding: 12px; border-radius: var(--radius-md);
    }
    .hero-search input { width: 100%; }
    .hero-search .btn { width: 100%; justify-content: center; }
    .search-icon { display: none; }
    .hero-stats { gap: 20px; }
    .stat-number { font-size: 1.4rem; }
    .section-header { flex-direction: column; }
    .filter-group { width: 100%; }
    .filter-group select { flex: 1; }
    .documents-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .modal { border-radius: var(--radius-lg); }
    .cta-content { padding: 50px 24px; }
    .cta-content h2 { font-size: 1.6rem; }
    .library-header { flex-direction: column; align-items: flex-start; }

    /* Mobile auth */
    .mobile-auth-buttons, .mobile-logout-btn { padding-top: 8px; border-top: 1px solid var(--border-subtle); }
}
@media (min-width: 769px) {
    .mobile-auth-buttons, .mobile-logout-btn { display: none !important; }
}
@media (max-width: 480px) {
    .nav-inner { padding: 0 16px; }
    #documents-section, .library-page { padding: 40px 16px 60px; }
    .doc-card-header { height: 110px; }
    .funds-presets { grid-template-columns: repeat(2, 1fr); }
}
