/* Import Google Fonts: Plus Jakarta Sans for a high-end, clean SaaS feel */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Sleek Dark Glow Palette (Linear/Vercel SaaS Inspired) */
    --bg-main: #090c15;           /* Rich midnight slate */
    --bg-card: rgba(17, 22, 38, 0.75); /* Deep dark glass */
    --bg-header: rgba(9, 12, 21, 0.8);
    --border-color: rgba(255, 255, 255, 0.08); /* Clean mechanical borders */
    --border-hover: rgba(99, 102, 241, 0.4);   /* Indigo glow border */
    
    /* Text Colors */
    --text-primary: #f3f4f6;      /* Crisp ice white */
    --text-secondary: #a1a1aa;    /* Cool muted gray */
    --text-muted: #71717a;        /* Soft steel gray */
    
    /* Brand Accents (Glowing Indigo to Violet Gradient) */
    --accent-indigo: #6366f1;
    --accent-purple: #8b5cf6;
    --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-grad-hover: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    
    /* Layout Constants */
    --header-height: 60px;
    --container-width: 720px;
    --transition-speed: 0.15s;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Soft background glow meshes */
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

a {
    color: var(--accent-indigo);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

a:hover {
    color: var(--accent-purple);
}

/* Header & Navigation Bar (Floating Glassmorphism Style) */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
    will-change: transform;
}

header.header-hidden {
    transform: translateY(-100%);
}

.scroll-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent-grad);
    width: 0%;
    z-index: 1002;
    transition: width 0.1s ease-out;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.logo span {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Base navigation as vertical overlay dropdown */
nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--bg-header);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

nav.active {
    max-height: 350px;
}

nav ul {
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    gap: 1.25rem;
    align-items: center;
    width: 100%;
    list-style: none;
}

nav a {
    font-size: 1.05rem;
    width: 100%;
    text-align: center;
    padding: 0.4rem 0;
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
}

nav a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

nav .btn {
    width: 100%;
    padding: 0.6rem 0;
}

/* Buttons (Premium Glass & Glowing Gradients) */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.4rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: 1px solid transparent;
    outline: none;
    text-decoration: none !important;
}

.btn-primary {
    background: var(--accent-grad);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
    border: none;
}

.btn-primary:hover {
    background: var(--accent-grad-hover);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Ad Slots styling (Coordinated with Premium dark styling) */
.ad-slot {
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border-color);
    margin: 1.5rem auto;
    padding: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-radius: var(--border-radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
}

.ad-slot::before {
    content: "SPONSORIZZATO";
    letter-spacing: 2px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* Hero Section (Clean white card background style) */
.hero {
    background-color: var(--bg-card);
    padding: 3rem 0 2rem 0;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    margin-top: var(--header-height);
}

.hero-content {
    max-width: var(--container-width);
    margin: 0 auto;
}

.hero h1 {
    font-size: 1.75rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.hero-ctas {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    gap: 0.75rem;
    padding: 0 1rem;
}

.hero-ctas .btn {
    width: 100%;
}

/* Main Page Sections */
section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.section-title p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Grid of Cards (LinkedIn Style feeds/cards) */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.75rem;
    transition: border-color 0.3s ease, box-shadow var(--transition-speed) ease;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.card-link {
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.card-link:hover {
    text-decoration: underline;
}

/* Step Section */
.steps-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease;
}
.step-card:hover {
    border-color: var(--border-hover);
}

.step-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-indigo);
    margin-bottom: 0.5rem;
}

.step-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Article layouts (Guides) */
.article-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-top: calc(var(--header-height) + 1.5rem);
    align-items: stretch;
}

.main-content {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
}

.article-sidebar {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease;
}
.sidebar-box:hover {
    border-color: var(--border-hover);
}

.sidebar-box h4 {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.sidebar-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sidebar-box a {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.sidebar-box a:hover {
    color: var(--accent-indigo);
}

/* Article elements */
article h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

article h2 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

article h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

article p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

article ul, article ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

article li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

article blockquote {
    border-left: 4px solid var(--accent-indigo);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Quick Specs Table */
.quick-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
}

.quick-specs-table th, .quick-specs-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.quick-specs-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    color: var(--text-primary);
}

.quick-specs-table tr:last-child td {
    border-bottom: none;
}

/* CTA Box */
.cta-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    text-align: center;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease;
}
.cta-box:hover {
    border-color: var(--border-hover);
}

.cta-box h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.cta-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Formatter Page Layout (Two Columns Workspace) */
.formatter-layout {
    display: flex;
    flex-direction: column;
    height: auto;
    margin-top: calc(var(--header-height) + 0.5rem);
    gap: 1rem;
    margin-bottom: 2rem;
}

.editor-column, .preview-column {
    width: 100%;
    height: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.column-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.formatter-textarea {
    width: 100%;
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    color: var(--text-primary);
    background-color: rgba(0, 0, 0, 0.2);
    outline: none;
    transition: border-color var(--transition-speed) ease;
}

.formatter-textarea:focus {
    border-color: var(--accent-indigo);
    background-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.preview-scroll-wrapper {
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--border-radius-md);
    padding: 0.5rem;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    border: 1px solid var(--border-color);
}

.preview-sheet {
    width: 100%;
    max-width: 680px;
    min-height: auto;
    background: #ffffff;
    color: #1c1a18;
    padding: 1.5rem 1rem;
    box-shadow: none;
    border-radius: var(--border-radius-sm);
    box-sizing: border-box;
}

/* Desk-enhancements for A4 preview sheet when screen is wider than phone */
@media (min-width: 600px) {
    .preview-scroll-wrapper {
        padding: 2rem 1.5rem;
    }
    .preview-sheet {
        padding: 3.5rem 3rem;
        min-height: 840px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
        border-radius: 4px;
    }
}

.preview-sheet h1, 
.preview-sheet h2, 
.preview-sheet h3, 
.preview-sheet h4,
.preview-sheet p,
.preview-sheet li,
.preview-sheet th,
.preview-sheet td {
    color: #1c1a18 !important;
}

.preview-sheet h1 {
    font-size: 1.75rem;
    border-bottom: 2px solid #e5e5e0;
    padding-bottom: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.preview-sheet h2 {
    font-size: 1.35rem;
    border-bottom: 1px solid #e5e5e0;
    padding-bottom: 0.4rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.preview-sheet p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.preview-sheet th {
    background-color: #f4f3f0;
    border-bottom: 2px solid #d1d1cd;
    padding: 0.5rem;
}

.preview-sheet td {
    border-bottom: 1px solid #e5e5e0;
    padding: 0.5rem;
}

/* Dropdown styling */
.univ-select {
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md); /* Sharp mechanical corners */
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235e5e5e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.univ-select:hover {
    border-color: var(--border-hover);
}

/* FAQ Accordion */
.faq-accordion {
    max-width: 740px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
}

.faq-item summary {
    padding: 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--accent-indigo);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    background-color: #fafafa;
}

.faq-answer {
    padding: 0 1.25rem 1.25rem 1.25rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    font-size: 0.9rem;
}

/* Privacy/GDPR Content */
.policy-content {
    max-width: 740px;
    margin: 0 auto;
    padding-top: calc(var(--header-height) + 1.5rem);
}

.policy-content h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.policy-content h2 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.25rem;
}

.policy-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.policy-content ul {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.policy-content li {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

/* Footer (LinkedIn minimal format) */
footer {
    margin-top: auto;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    justify-content: center;
    width: 100%;
    padding: 0;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--accent-indigo);
    text-decoration: underline;
}

/* Hamburger Toggle Button Style */
.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1010;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
    border-radius: 2px;
    will-change: transform, opacity;
}

/* Animations for Hamburger Icon when Menu is Active */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Scroll Reveal Animation Styles */
.reveal {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    filter: blur(2px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity, filter;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* Interactive Hover Glow effects for SaaS Cards */
.card::before, .step-card::before, .sidebar-box::before, .cta-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: radial-gradient(
        800px circle at var(--mouse-x, 0px) var(--mouse-y, 0px),
        rgba(99, 102, 241, 0.05),
        transparent 45%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.card:hover::before, .step-card:hover::before, .sidebar-box:hover::before, .cta-box:hover::before {
    opacity: 1;
}

.card *, .step-card *, .sidebar-box *, .cta-box * {
    position: relative;
    z-index: 2;
}

/* Stagger animations for list elements */
.cards-grid .card:nth-child(1) { transition-delay: 0.05s; }
.cards-grid .card:nth-child(2) { transition-delay: 0.1s; }
.cards-grid .card:nth-child(3) { transition-delay: 0.15s; }
.cards-grid .card:nth-child(4) { transition-delay: 0.2s; }
.cards-grid .card:nth-child(5) { transition-delay: 0.25s; }
.cards-grid .card:nth-child(6) { transition-delay: 0.3s; }

.steps-container .step-card:nth-child(1) { transition-delay: 0.05s; }
.steps-container .step-card:nth-child(2) { transition-delay: 0.1s; }
.steps-container .step-card:nth-child(3) { transition-delay: 0.15s; }

/* Padding optimization on very small viewports */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    .main-content {
        padding: 1.5rem 1rem;
    }
}
