/* DocDireto — Shared Styles (tokens, reset, header, footer, fab, utilities) */

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

/* ========== Design Tokens ========== */
:root {
    --bg: #0C0514;
    --bg-2: #130824;
    --fg: #F2ECFF;
    --muted: #C7BEE4;
    --primary: #A785FF;
    --primary-2: #6E4BFF;
    --card: #1B1230;
    --border: #2F2150;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;

    --container: 1200px;
    --header-h: 64px;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(167, 133, 255, 0.2), 0 0 80px rgba(110, 75, 255, 0.08);
    --shadow-glow-sm: 0 0 12px rgba(167, 133, 255, 0.15);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--fg); }
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font-family: inherit; color: inherit; }

::selection { background: rgba(167, 133, 255, 0.3); color: var(--fg); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ========== Utilities ========== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0;
    margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: var(--fg);
    box-shadow: var(--shadow-glow-sm);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: var(--fg);
}

.btn-ghost {
    background: transparent;
    color: var(--fg);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--primary);
    background: rgba(167, 133, 255, 0.08);
    color: var(--fg);
}

.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ========== Header ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    border-bottom: 1px solid transparent;
    transition: all var(--transition);
    background: transparent;
}
.header--scrolled {
    background: rgba(12, 5, 20, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--fg);
    letter-spacing: -0.02em;
}
.logo img { width: 32px; height: 32px; }
.logo span {
    background: linear-gradient(135deg, var(--fg), var(--muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav a {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition);
}
.nav a:hover { color: var(--fg); }

.header-cta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--fg);
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== Footer ========== */
.footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 60px 0 28px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 50px;
}
.footer-brand p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.65;
    margin-top: 18px;
    max-width: 360px;
}
.footer-col h4 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg);
    margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
    color: var(--muted);
    font-size: 0.9rem;
    transition: color var(--transition);
}
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
    padding-top: 28px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    color: var(--muted);
    font-size: 0.82rem;
}

/* ========== FAB ========== */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(110, 75, 255, 0.5);
    z-index: 40;
    transition: transform var(--transition);
    animation: fabPulse 3s ease-in-out infinite;
}
.fab:hover { transform: scale(1.08); }
.fab svg { width: 28px; height: 28px; color: var(--fg); }

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 8px 30px rgba(110, 75, 255, 0.5), 0 0 0 0 rgba(167, 133, 255, 0.4); }
    50% { box-shadow: 0 8px 30px rgba(110, 75, 255, 0.5), 0 0 0 14px rgba(167, 133, 255, 0); }
}

/* ========== Reveal on scroll ========== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Section base ========== */
.section { padding: 100px 0; position: relative; }
.section--alt { background: var(--bg-2); }

.section-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 60px;
}
.section-eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--primary);
    margin-bottom: 14px;
}
.section-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: 16px;
}
.section-subtitle {
    font-size: clamp(0.95rem, 1.3vw, 1.08rem);
    color: var(--muted);
    line-height: 1.65;
}

/* ========== Responsive base ========== */
@media (max-width: 1024px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    .footer-brand { grid-column: span 2; }
}

@media (max-width: 768px) {
    .nav,
    .header-cta .btn-ghost { display: none; }
    .hamburger { display: flex; }

    .nav.mobile-open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(12, 5, 20, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid var(--border);
        padding: 20px 24px;
        gap: 18px;
        align-items: flex-start;
    }

    .section { padding: 70px 0; }
    .section-header { margin-bottom: 44px; }

    .footer-grid { grid-template-columns: 1fr; gap: 36px; text-align: center; }
    .footer-brand { grid-column: span 1; }
    .footer-brand p { margin: 18px auto 0; }
    .footer-col ul { align-items: center; }

    .fab { bottom: 20px; right: 20px; width: 52px; height: 52px; }
    .fab svg { width: 24px; height: 24px; }
}

@media (max-width: 480px) {
    .container { padding: 0 18px; }
}

/* ========== Modal base (reusable across pages) ========== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 5, 20, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal-backdrop.open {
    display: flex;
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 34px;
    max-width: 480px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-glow), 0 24px 80px rgba(0, 0, 0, 0.7);
}
.modal-backdrop.open .modal-card {
    animation: modalCardPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalCardPop {
    from { transform: scale(0.94) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: rgba(167, 133, 255, 0.06);
    border: 1px solid var(--border);
    transition: all var(--transition);
    z-index: 2;
}
.modal-close:hover {
    color: var(--fg);
    background: rgba(167, 133, 255, 0.15);
    border-color: var(--primary);
}
.modal-close svg { width: 16px; height: 16px; }

.modal-body { position: relative; }
.modal-body > [data-state] { display: none; }
.modal-body > [data-state].active { display: block; }

/* ========== Hidden utility ========== */
.hidden { display: none !important; }
