:root {
    --oce-primary: #0d6efd;
    --oce-primary-dark: #0a3fa8;
    --oce-ink: #0b1f47;
    --oce-muted: #64748b;
    --oce-surface: #ffffff;
    --oce-soft: #f5f9ff;
    --oce-border: #dbe7f5;
    --oce-success: #0f8349;
    --oce-danger: #c73636;
    --oce-shadow: 0 16px 48px rgba(18, 70, 130, .10);
    --oce-shadow-sm: 0 4px 14px rgba(18, 70, 130, .06);
}

html { scroll-behavior: smooth; }
body {
    background: var(--oce-surface);
    color: var(--oce-ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}
a { color: var(--oce-primary-dark); }
a:hover { color: var(--oce-primary); }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; }
.py-lg-6 { padding-top: 4.5rem !important; padding-bottom: 4.5rem !important; }

.skip-link {
    position: fixed;
    left: .75rem;
    top: .75rem;
    z-index: 2000;
    transform: translateY(-160%);
    background: #000;
    color: #fff;
    padding: .6rem .9rem;
    border-radius: .5rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header { backdrop-filter: blur(14px); background-color: rgba(255, 255, 255, 0.95); }
.navbar-brand { color: var(--oce-ink); letter-spacing: -.02em; }
.site-logo { display: block; width: min(220px, 52vw); height: auto; }
.footer-site-logo { width: min(220px, 78vw); }
.brand-accent { color: var(--oce-primary); }
.nav-link { color: #31435f; font-weight: 600; padding: .5rem .8rem !important; border-radius: .5rem; transition: background .15s ease, color .15s ease; }
.nav-link:hover, .nav-link:focus { color: var(--oce-primary); background-color: #f0f6ff; }

.btn-primary {
    --bs-btn-bg: var(--oce-primary);
    --bs-btn-border-color: var(--oce-primary);
    --bs-btn-hover-bg: var(--oce-primary-dark);
    --bs-btn-hover-border-color: var(--oce-primary-dark);
}
.btn-outline-primary {
    --bs-btn-color: var(--oce-primary-dark);
    --bs-btn-border-color: #97bdfc;
    --bs-btn-hover-bg: var(--oce-primary);
    --bs-btn-hover-border-color: var(--oce-primary);
}

.hero-section {
    overflow: hidden;
    background:
        radial-gradient(circle at 92% 18%, rgba(51, 170, 255, .18), transparent 32%),
        radial-gradient(circle at 8% 85%, rgba(13, 110, 253, .12), transparent 28%),
        linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    border-bottom: 1px solid #edf4fc;
}
.hero-section h1 { letter-spacing: -.04em; max-width: 14ch; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    padding: .38rem .75rem;
    border-radius: 999px;
    background: #eaf3ff;
    color: #0755bd;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.hero-regex-card {
    padding: 1.5rem;
    border: 1px solid var(--oce-border);
    border-radius: 1.5rem;
    background: rgba(255,255,255,.98);
    box-shadow: var(--oce-shadow);
}
.regex-code {
    margin: 0;
    padding: 1rem;
    overflow: auto;
    border: 1px solid #dfe9f7;
    border-radius: .9rem;
    background: #f4f7ff;
    color: #113e92;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.5;
}
.sample {
    display: flex;
    gap: .65rem;
    align-items: center;
    margin-top: .65rem;
    padding: .65rem .75rem;
    border-radius: .8rem;
    font-size: .92rem;
    font-family: inherit;
}
.sample.success { background: #eaf9f1; color: var(--oce-success); border: 1px solid #c9ebd8; }
.sample.danger { background: #fff0f0; color: var(--oce-danger); border: 1px solid #f9d3d3; }
.mini-answer {
    border-left: 4px solid var(--oce-primary);
    padding: .75rem 1rem;
    background: var(--oce-soft);
    border-radius: 0 .75rem .75rem 0;
    font-size: .92rem;
}

.stats-row .stat-card {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-height: 86px;
    justify-content: center;
    padding: .85rem;
    background: #fff;
    border: 1px solid var(--oce-border);
    border-radius: 1rem;
    box-shadow: var(--oce-shadow-sm);
}
.stat-card strong { font-size: 1.35rem; color: var(--oce-primary-dark); }
.stat-card span { font-size: .76rem; color: var(--oce-muted); }

.section-heading { margin-bottom: 2rem; }
.section-heading h2 { margin: .6rem 0 .25rem; letter-spacing: -.025em; font-weight: 800; }
.section-heading p { margin: 0; color: var(--oce-muted); }

.category-card {
    display: block;
    height: 100%;
    padding: 1.35rem;
    border: 1px solid var(--oce-border);
    border-radius: 1.25rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    box-shadow: var(--oce-shadow-sm);
}
.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(18, 70, 130, .10);
    border-color: #a9c9f5;
    color: inherit;
}
.category-card h3 { margin: .9rem 0 .4rem; font-size: 1.1rem; font-weight: 800; color: var(--oce-ink); }
.category-card p { min-height: 3.2em; color: var(--oce-muted); font-size: .9rem; }
.category-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #eaf3ff;
    color: var(--oce-primary);
    font-size: 1.15rem;
}
.category-icon.large { width: 58px; height: 58px; border-radius: 18px; font-size: 1.4rem; flex: 0 0 auto; }

.bg-soft { background: var(--oce-soft); border-block: 1px solid #eaf1fa; }
.regex-card, .regex-list-item, .content-card, .search-panel {
    position: relative;
    padding: 1.35rem;
    border: 1px solid var(--oce-border);
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 6px 20px rgba(18,70,130,.04);
}
.regex-card h3 a, .regex-list-item h2 a { color: var(--oce-ink); text-decoration: none; }
.regex-card h3 a:hover, .regex-list-item h2 a:hover { color: var(--oce-primary); }
.icon-button {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--oce-border);
    background: #fff;
    color: var(--oce-primary-dark);
    transition: background-color .15s ease, border-color .15s ease;
}
.icon-button:hover { background: var(--oce-soft); border-color: var(--oce-primary); }
.stretched-link-safe { font-weight: 700; text-decoration: none; color: var(--oce-primary-dark); }
.stretched-link-safe:hover { color: var(--oce-primary); }

.cta-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.2rem;
    border: 1px solid #cfe1fb;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, #f9fcff, #edf6ff);
    box-shadow: var(--oce-shadow-sm);
}
.page-hero {
    background:
        radial-gradient(circle at 85% 20%, rgba(13, 110, 253, .10), transparent 30%),
        linear-gradient(180deg, #fff, #f8fbff);
    border-bottom: 1px solid #edf4fc;
}
.breadcrumb a { text-decoration: none; }
.answer-box {
    padding: 1.5rem;
    border: 1px solid #bcd8fb;
    border-left: 5px solid var(--oce-primary);
    border-radius: 1.15rem;
    background: #f7fbff;
}
.explanation-list { padding-left: 1.3rem; margin-bottom: 0; }
.explanation-list li { padding: .45rem 0; line-height: 1.6; }
.check-list { padding: 0; margin: 0; list-style: none; }
.check-list li { display: flex; gap: .65rem; padding: .5rem 0; }
.check-list i { color: var(--oce-success); margin-top: .3rem; }
.example-list .sample { margin-top: .6rem; }

/* Tabs Multi-Linguaggio */
.snippet-tabs .nav-link {
    border-radius: .65rem;
    font-size: .88rem;
    font-weight: 600;
    color: #4b6182;
    padding: .45rem .85rem;
    border: 1px solid transparent;
}
.snippet-tabs .nav-link.active {
    background-color: var(--oce-primary);
    color: #fff;
    border-color: var(--oce-primary);
}
.code-snippet-box {
    background-color: #0b172a;
    color: #e2e8f0;
    border-radius: .85rem;
    font-size: .9rem;
    line-height: 1.55;
    overflow-x: auto;
}

.site-footer { background: #f7faff; border-top: 1px solid #e4edf8; }
.policy-content { padding: clamp(1.25rem, 3vw, 2.5rem); }
.policy-content h2 { margin-top: 2rem; margin-bottom: .75rem; font-size: 1.25rem; color: var(--oce-ink); }
.policy-content h2:first-of-type { margin-top: 1.25rem; }
.policy-content li { margin-bottom: .45rem; }
.policy-content .table { --bs-table-border-color: var(--oce-border); }
.footer-links li { margin-bottom: .45rem; }
.footer-links a { color: #40536d; text-decoration: none; }
.footer-links a:hover { color: var(--oce-primary); }

/* Tester styling */
.tester-highlight {
    min-height: 140px;
    max-height: 300px;
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--oce-border);
    border-radius: 1rem;
    background: #fbfdff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: .92rem;
    line-height: 1.6;
}
.tester-highlight .match-highlight {
    padding: .12em .25em;
    background: #c3f3d7;
    color: #064e29;
    border-radius: .3rem;
    border: 1px solid #82e2ab;
    font-weight: 600;
}
.match-table-wrapper {
    display: grid;
    gap: .65rem;
    max-height: 400px;
    overflow-y: auto;
}
.match-row {
    border-left: 4px solid var(--oce-primary);
}

.error-mark {
    font-size: clamp(5rem, 16vw, 11rem);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.08em;
    color: #e2edfb;
}

.max-w-600 { max-width: 600px; }

.toast-copy {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1080;
    padding: .85rem 1.25rem;
    color: #fff;
    background: #102344;
    border-radius: .85rem;
    font-weight: 600;
    font-size: .92rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    opacity: 1;
    transition: opacity .3s ease;
}
.toast-copy.fade-out { opacity: 0; }

@media (max-width: 991.98px) {
    .hero-section h1 { max-width: none; }
    .cta-panel { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 575.98px) {
    .hero-regex-card, .content-card, .regex-card, .regex-list-item, .search-panel { padding: 1rem; border-radius: 1rem; }
    .stats-row .stat-card { padding: .65rem; }
    .stat-card strong { font-size: 1.1rem; }
    .stat-card span { font-size: .7rem; }
    .cta-panel { padding: 1.5rem; }
}


/* Public statistics charts */
.statistics-chart-wrap {
    position: relative;
    min-height: 320px;
}
.statistics-chart-wrap canvas {
    width: 100% !important;
    height: 320px !important;
}
@media (max-width: 575.98px) {
    .statistics-chart-wrap { min-height: 250px; }
    .statistics-chart-wrap canvas { height: 250px !important; }
}