/* Free SEO Tools - Modern Dark Theme CSS */

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #222222;
    --bg-card: rgba(26, 26, 26, 0.8);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #00ff88;
    --accent-secondary: #00d4aa;
    --accent-gradient: linear-gradient(135deg, #00ff88 0%, #00d4aa 100%);
    --warning: #ffaa00;
    --error: #ff4444;
    --info: #4488ff;
    --border-color: #333333;
    --border-radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
}

.logo svg {
    flex-shrink: 0;
}

.nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-badge {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}

/* Usage Bar */
.usage-bar {
    background: var(--bg-tertiary);
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.usage-items {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.usage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.usage-label {
    color: var(--text-secondary);
    white-space: nowrap;
}

.usage-bar-wrapper {
    width: 100px;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.usage-bar-fill.usage-bar-yellow {
    background: linear-gradient(135deg, #ffaa00, #ff8800);
}

.usage-bar-fill.usage-bar-blue {
    background: linear-gradient(135deg, #4488ff, #2266ff);
}

.usage-bar-fill.usage-bar-purple {
    background: linear-gradient(135deg, #aa44ff, #8822ff);
}

.usage-value {
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Riga introduttiva che spiega gratuito + limiti condivisi/personali */
.usage-intro {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}
.usage-intro strong {
    color: var(--text-secondary);
}

/* Etichetta secondaria che indica l'ambito (oggi/mese, comune/personale) */
.usage-scope {
    display: inline-block;
    font-size: 0.68rem;
    color: var(--text-muted);
    opacity: 0.75;
    margin-left: 4px;
}

/* Il limite personale ha un piccolo separatore visivo */
.usage-item-personal {
    padding-left: 18px;
    border-left: 1px solid var(--border-color);
}

/* Stati di "quasi pieno" / "pieno" per avvisare l'utente */
.usage-bar-fill.near-full { filter: saturate(1.3); }

/* RESPONSIVE: su mobile le barre si impilano in modo leggibile */
@media (max-width: 768px) {
    .usage-items {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .usage-item {
        justify-content: space-between;
        gap: 10px;
    }
    .usage-bar-wrapper {
        flex: 1;
        width: auto;
        min-width: 60px;
    }
    .usage-item-personal {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-top: 10px;
        margin-top: 4px;
    }
    .usage-label { font-size: 0.8rem; }
    .usage-scope { display: block; margin-left: 0; }
}

/* Hero */
.hero {
    padding: 80px 0;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(0, 255, 136, 0.1) 0%, transparent 50%);
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

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

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tools Section */
.tools-section {
    padding: 60px 0;
    flex: 1;
    width: 100%;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    text-align: center;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.tool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.tool-card h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.tool-card-desc {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.favorite-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}

.favorite-btn:hover,
.favorite-btn.active {
    color: var(--warning);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    pointer-events: auto !important;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 6px;
}

/* Auth Page */
.auth-container {
    max-width: 440px;
    margin: 60px auto;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.auth-title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 30px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.auth-tab:hover,
.auth-tab.active {
    color: var(--text-primary);
}

.auth-tab.active {
    border-bottom-color: var(--accent);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tool Page */
.tool-page {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    flex: 1;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-sizing: border-box;
}

.tool-header {
    margin-bottom: 30px;
}

.tool-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.tool-description {
    color: var(--text-secondary);
}

.tool-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    backdrop-filter: blur(10px);
}

.tool-input-group {
    margin-bottom: 24px;
}

.tool-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.result-container {
    margin-top: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.result-toolbar {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.result-toolbar .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.result-content {
    padding: 24px;
    min-height: 200px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.result-content.streaming {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    height: 180px;
    margin-bottom: 24px;
}

.skeleton-line {
    height: 16px;
    margin-bottom: 12px;
}

.skeleton-line.short {
    width: 60%;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.alert-error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(68, 136, 255, 0.1);
    border: 1px solid var(--info);
    color: var(--info);
}

/* Ad Banners */
.ad-container {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.ad-banner {
    max-width: 100%;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.ad-banner img {
    max-width: 100%;
    max-height: 200px;
    display: block;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

/* History Page */
.history-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    backdrop-filter: blur(10px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.history-item-header h3 {
    font-size: 1.1rem;
}

.history-item-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.history-item-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.history-item-actions {
    display: flex;
    gap: 12px;
}

/* Shared Page */
.shared-page {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
}

.shared-header {
    text-align: center;
    margin-bottom: 30px;
}

.shared-content {
    white-space: pre-wrap;
    line-height: 1.8;
}

/* Admin Panel */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
}

.admin-sidebar-title {
    padding: 0 20px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.admin-nav-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.admin-nav-item.active {
    border-left: 3px solid var(--accent);
}

.admin-content {
    flex: 1;
    padding: 30px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 1.8rem;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.table tr:hover td {
    background: var(--bg-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .usage-items {
        flex-direction: column;
        align-items: center;
    }

    .usage-item {
        width: 100%;
        max-width: 300px;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .auth-container {
        margin: 20px;
        padding: 20px;
    }
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent);
}

.status-badge.inactive {
    background: rgba(255, 68, 68, 0.1);
    color: var(--error);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Field Builder */
.field-builder {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.field-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.field-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.field-item-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

/* ============================================================
   REDESIGN 2026 — override estetici (mantengono palette dark+verde)
   Caricati in fondo: vincono sugli stili precedenti.
   ============================================================ */

/* Header più pulito */
.header { background: var(--bg-secondary); position: sticky; top: 0; z-index: 50; }
.nav { gap: 18px; }
.nav-link { color: var(--text-secondary); }
.nav-link:hover { color: var(--text-primary); }

/* USAGE STRIP compatta e discreta */
.usage-bar { background: var(--bg-secondary); padding: 8px 0; }
.usage-intro { display: none; } /* la spiegazione va nel pannello a scomparsa */
.usage-items { gap: 18px; }
.usage-item { font-size: 0.76rem; gap: 7px; }
.usage-label { color: var(--text-secondary); }
.usage-scope { display: none; } /* nella strip compatta togliamo l'ambito inline */
.usage-bar-wrapper { width: 54px; height: 5px; }
.usage-value { font-size: 0.74rem; color: var(--text-primary); font-weight: 600; }
.usage-item-personal { padding-left: 14px; border-left: 1px solid var(--border-color); }

/* Bottone "Cosa significa?" e pannello info a scomparsa */
.usage-info-toggle {
    background: none; border: 1px solid var(--border-color); color: var(--text-muted);
    border-radius: 20px; padding: 3px 12px; font-size: 0.72rem; cursor: pointer;
    margin-left: 4px;
}
.usage-info-toggle:hover { color: var(--text-secondary); border-color: var(--text-muted); }
.usage-info-panel {
    display: none; background: var(--bg-tertiary); border-bottom: 1px solid var(--border-color);
    font-size: 0.84rem; color: var(--text-secondary); text-align: center; line-height: 1.5;
}
.usage-info-panel.open { display: block; }
.usage-info-panel .container { padding: 12px 24px; }
.usage-info-panel strong { color: var(--text-primary); }

/* HERO con alone verde + trust row */
.hero {
    padding: 72px 0 48px;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,255,136,0.08), transparent);
}
.hero-content h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
.hero-content p { max-width: 620px; margin-left: auto; margin-right: auto; }
.hero-trust {
    display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
    margin-top: 30px; color: var(--text-muted); font-size: 0.86rem;
}
.hero-trust span { display: flex; align-items: center; gap: 7px; }
.hero-trust .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* CARD ridisegnate */
.tools-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.tool-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--border-radius); padding: 22px;
    display: flex; flex-direction: column; gap: 12px; transition: 0.18s;
}
.tool-card:hover {
    border-color: rgba(0,255,136,0.4); transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.tool-card-header { align-items: flex-start; }
.tool-card h3 { font-size: 1.12rem; line-height: 1.3; }
.tool-card-desc { color: var(--text-secondary); font-size: 0.9rem; flex: 1; }
.tool-card .btn-block { margin-top: auto; }

/* Filtro Tutti/Preferiti come pill */
.tools-filter { gap: 8px; }
.filter-btn {
    padding: 7px 16px; border-radius: 20px; border: 1px solid var(--border-color);
    background: transparent; color: var(--text-secondary); font-size: 0.86rem; cursor: pointer;
}
.filter-btn:hover { color: var(--text-primary); }
.filter-btn.active { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); font-weight: 600; }

/* Footer con link informativi */
.footer { border-top: 1px solid var(--border-color); padding: 30px 0; margin-top: 40px; }
.footer-links { margin-bottom: 10px; }
.footer-links a { color: var(--text-secondary); margin: 0 8px; font-size: 0.86rem; }
.footer-links a:hover { color: var(--text-primary); }

/* TOOL PAGE layout a 3 colonne per le sidebar banner (desktop) */
.tool-layout {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) 160px;
    gap: 24px; align-items: start;
    max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
/* Quando manca una sidebar, quella colonna sparisce */
.tool-layout.no-left  { grid-template-columns: minmax(0, 1fr) 160px; }
.tool-layout.no-right { grid-template-columns: 160px minmax(0, 1fr); }
.tool-layout.no-left.no-right { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.tool-sidebar { position: sticky; top: 80px; }
.tool-sidebar .ad-banner img { width: 100%; border-radius: 8px; }
.tool-main-col { min-width: 0; }

@media (max-width: 1024px) {
    .tool-layout,
    .tool-layout.no-left,
    .tool-layout.no-right { grid-template-columns: 1fr; }
    .tool-sidebar { display: none; } /* niente sidebar su schermi stretti */
}

@media (max-width: 768px) {
    .hero { padding: 48px 0 32px; }
    .tools-grid { grid-template-columns: 1fr; }
    .hero-trust { gap: 16px; font-size: 0.8rem; }
}

/* AUTH (Accedi / Registrati) ridisegnati e uniformi */
.auth-container {
    width: 420px;
    max-width: calc(100% - 32px);
    margin: 70px auto;
    padding: 36px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    box-sizing: border-box;
}
.auth-container::before {
    content: "";
    display: block;
    width: 44px; height: 44px;
    margin: 0 auto 18px;
    border-radius: 12px;
    background: var(--accent-gradient);
}
.auth-title { font-size: 1.5rem; margin-bottom: 6px; }
.auth-subtitle {
    text-align: center; color: var(--text-muted);
    font-size: 0.9rem; margin-bottom: 26px;
}
/* I due form occupano sempre la STESSA larghezza piena */
#login-form, #register-form { width: 100%; }
.auth-container .form-group { width: 100%; }
.auth-container .form-input { width: 100%; box-sizing: border-box; }
.auth-container .btn-block { width: 100%; margin-top: 6px; }
.auth-tab { font-weight: 600; }
.auth-footer a { color: var(--accent); }

@media (max-width: 480px) {
    .auth-container { margin: 36px 16px; padding: 28px 20px; }
}

/* BARRA DI AVANZAMENTO a fasi (durante l'elaborazione del tool) */
.tool-progress { padding: 24px 0; }
.tool-progress-bar {
    width: 100%; height: 8px; background: var(--bg-tertiary);
    border-radius: 6px; overflow: hidden; margin-bottom: 14px;
}
.tool-progress-fill {
    height: 100%; width: 8%;
    background: var(--accent-gradient);
    border-radius: 6px;
    transition: width 0.5s ease;
}
.tool-progress-label {
    text-align: center; color: var(--text-secondary);
    font-size: 0.92rem; display: flex; align-items: center;
    justify-content: center; gap: 10px;
}
.tool-progress-label::before {
    content: ""; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); animation: pulseDot 1.1s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* PAGINE INFORMATIVE (Come funziona, ecc.) */
.info-page { padding: 50px 0 30px; }
.info-content { max-width: 760px; margin: 0 auto; }
.info-content h1 { font-size: 2.2rem; margin-bottom: 16px; }
.info-lead { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 36px; line-height: 1.7; }
.info-content h2 { font-size: 1.3rem; margin: 34px 0 12px; color: var(--text-primary); }
.info-content p { color: var(--text-secondary); margin-bottom: 14px; line-height: 1.7; }
.info-content strong { color: var(--text-primary); }
.info-steps { margin: 0 0 14px; padding-left: 22px; color: var(--text-secondary); line-height: 1.7; }
.info-steps li { margin-bottom: 10px; }
.info-cta { margin-top: 40px; text-align: center; }
