/* ============================================
   A.I. ADVOCACIA INTELIGENTE — Platform CSS
   Dark tech-law aesthetic with circuit patterns
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

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

:root {
    --bg-deep: #080c14;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #283548;
    --text: #e2e8f0;
    --text-dim: #94a3b8;
    --text-bright: #f8fafc;
    --accent: #2dd4bf;
    --accent-glow: rgba(45, 212, 191, 0.25);
    --border: rgba(45, 212, 191, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --font: 'Outfit', sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: 0.3s; }
a:hover { opacity: 0.85; }

/* ── CIRCUIT BOARD BACKGROUND ── */
.circuit-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

/* ── NAVBAR ── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(8, 12, 20, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.navbar .logo {
    display: flex; align-items: center; gap: 0.6rem;
    font-weight: 800; font-size: 1.5rem;
    color: var(--text-bright);
    letter-spacing: -0.03em;
}

.logo .ai-mark {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 8px;
    padding: 0.15rem 0.5rem;
    line-height: 1;
    position: relative;
}

.logo .ai-mark::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 12px;
    border: 1px solid rgba(45, 212, 191, 0.2);
}

.navbar-links { display: flex; gap: 1.5rem; align-items: center; }

.navbar-links a {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}
.navbar-links a:hover { color: var(--accent); opacity: 1; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-deep);
    box-shadow: 0 0 30px var(--accent-glow);
}
.btn-primary:hover {
    background: #5eead4;
    box-shadow: 0 0 50px rgba(45, 212, 191, 0.4);
    transform: translateY(-2px);
    color: var(--bg-deep);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}
.btn-outline:hover {
    background: rgba(45, 212, 191, 0.1);
    color: var(--accent);
}

.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-bright);
}

/* ── HERO ── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 8rem 2rem 4rem;
    z-index: 1;
}

.hero-content {
    max-width: 860px;
    text-align: center;
}

.hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(45, 212, 191, 0.08);
    border: 1px solid rgba(45, 212, 191, 0.2);
    border-radius: 100px;
    padding: 0.4rem 1.2rem;
    margin-bottom: 2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: fadeInUp 0.8s ease;
}

.hero-badge .dot {
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero h1 {
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.8s 0.1s both;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-dim);
    font-weight: 400;
    max-width: 600px;
    margin: 1.5rem auto 2.5rem;
    animation: fadeInUp 0.8s 0.2s both;
}

.hero-cta {
    display: flex; gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s 0.3s both;
}

.hero-stats {
    display: flex; gap: 3rem;
    justify-content: center;
    margin-top: 4rem;
    animation: fadeInUp 0.8s 0.4s both;
}

.hero-stats .stat {
    text-align: center;
}
.hero-stats .stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--mono);
}
.hero-stats .stat-label {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.2rem;
}

/* ── SECTIONS ── */
.section {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-bright);
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--text-dim);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 3rem;
}

/* ── VOLUME GRID (Landing) ── */
.volumes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.volume-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.volume-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--card-accent);
    opacity: 0.8;
}

.volume-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    background: radial-gradient(circle, var(--card-accent) 0%, transparent 70%);
    opacity: 0.06;
    transition: opacity 0.4s;
}

.volume-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.volume-card:hover::after { opacity: 0.12; }

.volume-num {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--card-accent);
    margin-bottom: 1rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.volume-num::before {
    content: '';
    width: 20px; height: 1px;
    background: var(--card-accent);
}

.volume-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
    line-height: 1.25;
}

.volume-card .vol-sub {
    font-size: 0.9rem;
    color: var(--card-accent);
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.volume-card p {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
}

/* ── FEATURES ── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 2rem;
    transition: all 0.3s;
}
.feature-item:hover {
    border-color: var(--border);
    background: var(--bg-card-hover);
}

.feature-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: rgba(45, 212, 191, 0.1);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.2rem;
    font-size: 1.3rem;
}

.feature-item h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 0.5rem;
}

.feature-item p {
    font-size: 0.9rem;
    color: var(--text-dim);
}

/* ── FOOTER TAGLINE ── */
.footer-tagline {
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-tagline .tagline {
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.footer-tagline .tagline span { color: var(--accent); font-weight: 600; }

/* ── LOGIN / REGISTER FORMS ── */
.auth-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    position: relative;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 2rem; right: 2rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.auth-card .logo-mini {
    text-align: center;
    margin-bottom: 2rem;
}
.auth-card .logo-mini .ai-mark {
    font-family: var(--mono);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--accent);
    border: 2px solid var(--accent);
    border-radius: 12px;
    padding: 0.3rem 0.8rem;
    display: inline-block;
}

.auth-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}

.auth-card .auth-sub {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    color: var(--text-bright);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all 0.3s;
    outline: none;
}
.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: rgba(255,255,255,0.06);
}
.form-group input::placeholder { color: var(--text-dim); opacity: 0.5; }

.auth-card .btn { width: 100%; justify-content: center; margin-top: 0.5rem; }

.auth-card .auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}
.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ── DASHBOARD ── */
.dash-wrap {
    padding-top: 5rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.dash-header {
    padding: 3rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dash-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-bright);
    margin-bottom: 0.3rem;
}
.dash-header p { color: var(--text-dim); font-size: 1rem; }

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
}

.dash-card {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.4s;
    display: flex;
    flex-direction: column;
}
.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.1);
}

.dash-card-top {
    height: 6px;
    background: var(--card-accent);
}

.dash-card-body {
    padding: 1.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.dash-card-num {
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--card-accent);
    margin-bottom: 0.6rem;
}

.dash-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-bright);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.dash-card .vol-sub {
    font-size: 0.85rem;
    color: var(--card-accent);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.dash-card p {
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.5;
    flex: 1;
}

.dash-card-footer {
    padding: 1.2rem 1.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-bar-wrap {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    margin-right: 1rem;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--card-accent);
    transition: width 0.6s ease;
}

.dash-card-footer .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.82rem;
    white-space: nowrap;
}

/* ── VOLUME READER ── */
.reader-wrap {
    padding-top: 5rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.reader-header {
    padding: 2rem 2rem 1rem;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.reader-header .back-link {
    color: var(--text-dim);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.reader-header .back-link:hover { color: var(--accent); }

.reader-body {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem;
}

.reader-title-bar {
    border-bottom: 2px solid var(--card-accent, var(--accent));
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
}

.reader-title-bar .vol-label {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--card-accent, var(--accent));
    margin-bottom: 0.5rem;
}

.reader-title-bar h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.15;
}
.reader-title-bar h1 span {
    display: block;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--card-accent, var(--accent));
    margin-top: 0.3rem;
}

.reader-content {
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 3rem;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
}

.reader-content h2, .reader-content h3 {
    color: var(--text-bright);
    font-weight: 700;
    margin: 2rem 0 1rem;
}
.reader-content h2 { font-size: 1.5rem; }
.reader-content h3 { font-size: 1.2rem; }
.reader-content p { margin-bottom: 1rem; }
.reader-content ul, .reader-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.reader-content li { margin-bottom: 0.5rem; }
.reader-content strong { color: var(--text-bright); }

/* ── ANIMATIONS ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.fade-up {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeInUp 0.7s ease forwards;
}
.fade-up:nth-child(1) { animation-delay: 0.05s; }
.fade-up:nth-child(2) { animation-delay: 0.1s; }
.fade-up:nth-child(3) { animation-delay: 0.15s; }
.fade-up:nth-child(4) { animation-delay: 0.2s; }
.fade-up:nth-child(5) { animation-delay: 0.25s; }
.fade-up:nth-child(6) { animation-delay: 0.3s; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .navbar { padding: 0.8rem 1.2rem; }
    .navbar .logo { font-size: 1.2rem; }
    .hero { padding: 7rem 1.2rem 3rem; }
    .hero-stats { gap: 1.5rem; }
    .hero-stats .stat-num { font-size: 1.6rem; }
    .section { padding: 4rem 1.2rem; }
    .volumes-grid { grid-template-columns: 1fr; }
    .dash-grid { grid-template-columns: 1fr; padding: 1rem 1.2rem 3rem; }
    .auth-card { padding: 2rem 1.5rem; }
    .reader-content { padding: 1.5rem; }
    .reader-title-bar h1 { font-size: 1.6rem; }
}
