/* ==========================================================================
   Analisi Prestazioni Web & Core Web Vitals - Styles
   ========================================================================== */

/* --- Hero & Form --- */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #ffffff;
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, #ffffff 0%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.perf-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2.2rem;
}

.perf-feature-badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-align: left;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.perf-feature-badge:hover {
    transform: translateY(-2px);
    border-color: rgba(147, 197, 253, 0.4);
}

.perf-feature-badge i {
    font-size: 1.5rem;
    color: #60a5fa;
    flex-shrink: 0;
}

.perf-feature-badge .badge-text h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f8fafc;
    margin: 0 0 0.2rem;
}

.perf-feature-badge .badge-text p {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.3;
}

.perf-form-container {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.6rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    max-width: 760px;
    margin: 0 auto;
}

.perf-input-group {
    display: flex;
    gap: 0.5rem;
}

.perf-input-group input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.perf-input-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.perf-input-group .btn-primary {
    padding: 1rem 1.8rem;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.perf-input-group .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.perf-input-group .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.url-validation-message {
    font-size: 0.9rem;
    margin-top: 0.6rem;
    min-height: 1.3rem;
    text-align: left;
}

.url-validation-message.success {
    color: #4ade80;
}

.url-validation-message.error {
    color: #f87171;
}

/* --- Loading Section --- */
.loading-section {
    padding: 3.5rem 0;
    background: #f8fafc;
}

.loading-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.loading-spinner {
    font-size: 2.5rem;
    color: #3b82f6;
    margin-bottom: 1.2rem;
}

.loading-content h3 {
    font-size: 1.35rem;
    color: #1e293b;
    margin-bottom: 1.8rem;
}

.loading-steps {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-align: left;
}

.loading-steps .step {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    background: #f8fafc;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.loading-steps .step.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
}

.loading-steps .step.completed {
    background: #f0fdf4;
    color: #15803d;
}

.loading-steps .step.completed i {
    color: #16a34a;
}

/* --- Results Section --- */
.results-section {
    padding: 3rem 0;
    background: #f8fafc;
}

.results-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    background: #ffffff;
    padding: 1.25rem 1.75rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

.results-header-info h2 {
    font-size: 1.35rem;
    color: #0f172a;
    margin: 0 0 0.25rem;
}

.results-header-info p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Score Overview Card */
.perf-score-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 8px solid #e2e8f0;
    transition: all 0.3s ease;
}

.score-circle.score-good {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #15803d;
}

.score-circle.score-average {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #b45309;
}

.score-circle.score-poor {
    border-color: #ef4444;
    background: #fef2f2;
    color: #b91c1c;
}

.score-circle .score-number {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

.score-circle .score-max {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.perf-score-details h3 {
    font-size: 1.4rem;
    color: #0f172a;
    margin: 0 0 0.4rem;
}

.perf-score-details p {
    font-size: 1rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.perf-quick-stats {
    display: flex;
    gap: 1.5rem;
    border-left: 1px solid #e2e8f0;
    padding-left: 1.5rem;
}

.quick-stat-item {
    text-align: center;
}

.quick-stat-item .stat-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    font-weight: 600;
}

.quick-stat-item .stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

/* Core Web Vitals Grid */
.perf-grid-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2.5rem 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.perf-grid-title i {
    color: #3b82f6;
}

.cwv-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.perf-metric-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.35rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.perf-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.perf-metric-card.good {
    border-left: 5px solid #22c55e;
}

.perf-metric-card.needs-improvement {
    border-left: 5px solid #f59e0b;
}

.perf-metric-card.poor {
    border-left: 5px solid #ef4444;
}

.perf-metric-card.info {
    border-left: 5px solid #3b82f6;
}

.metric-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.metric-name-box h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.2rem;
}

.metric-name-box span {
    font-size: 0.8rem;
    color: #64748b;
}

.metric-status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-status-badge.good {
    background: #dcfce7;
    color: #15803d;
}

.metric-status-badge.needs-improvement {
    background: #fef3c7;
    color: #b45309;
}

.metric-status-badge.poor {
    background: #fee2e2;
    color: #b91c1c;
}

.metric-status-badge.info {
    background: #e0f2fe;
    color: #0369a1;
}

.metric-value-box {
    margin-bottom: 0.75rem;
}

.metric-main-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
}

.metric-threshold-guide {
    font-size: 0.8rem;
    color: #64748b;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
}

.metric-threshold-guide strong {
    color: #16a34a;
}

/* Resource Breakdown Card */
.perf-resources-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

.resource-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.resource-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.resource-pill i {
    font-size: 1.1rem;
}

.resource-pill .res-name {
    color: #475569;
}

.resource-pill .res-count {
    color: #0f172a;
    font-weight: 700;
}

/* Recommendations Card */
.perf-recommendations-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 2rem;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1rem;
}

.perf-rec-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.perf-rec-item.priority-high {
    border-left: 4px solid #ef4444;
    background: #fffafa;
}

.perf-rec-item.priority-medium {
    border-left: 4px solid #f59e0b;
    background: #fffdf5;
}

.perf-rec-item.success {
    border-left: 4px solid #22c55e;
    background: #f0fdf4;
}

.rec-icon-box {
    font-size: 1.35rem;
    color: #f59e0b;
    flex-shrink: 0;
    padding-top: 0.1rem;
}

.perf-rec-item.priority-high .rec-icon-box {
    color: #ef4444;
}

.rec-content {
    flex: 1;
}

.rec-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 0.35rem;
}

.rec-badge.priority-high {
    background: #fee2e2;
    color: #b91c1c;
}

.rec-badge.priority-medium {
    background: #fef3c7;
    color: #b45309;
}

.rec-text {
    font-size: 0.95rem;
    color: #334155;
    margin: 0;
    line-height: 1.5;
}

/* --- Educational Content Sections --- */
.guide-section {
    padding: 4rem 0;
    background: #ffffff;
}

.guide-section.alt-bg {
    background: #f8fafc;
}

.section-header {
    text-align: center;
    max-width: 750px;
    margin: 0 auto 3rem;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.section-header p {
    font-size: 1.05rem;
    color: #64748b;
    line-height: 1.6;
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

.pillar-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    text-align: center;
    transition: transform 0.2s ease;
}

.pillar-card:hover {
    transform: translateY(-4px);
}

.pillar-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
}

.pillar-card h3 {
    font-size: 1.25rem;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.pillar-card p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Core Web Vitals Explanation Grid */
.cwv-explanation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.cwv-guide-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.cwv-guide-box .box-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.cwv-guide-box .box-header i {
    font-size: 1.5rem;
    color: #2563eb;
}

.cwv-guide-box .box-header h3 {
    font-size: 1.2rem;
    color: #0f172a;
    margin: 0;
}

.cwv-guide-box p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

.cwv-guide-thresholds {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.th-pill {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.th-pill.good {
    background: #dcfce7;
    color: #15803d;
}

.th-pill.average {
    background: #fef3c7;
    color: #b45309;
}

.th-pill.poor {
    background: #fee2e2;
    color: #b91c1c;
}

.cwv-tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cwv-tips-list li {
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cwv-tips-list li i {
    color: #10b981;
    font-size: 0.75rem;
}

/* Optimization Best Practice Grid */
.bp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.bp-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
}

.bp-card h3 {
    font-size: 1.15rem;
    color: #0f172a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.bp-card h3 i {
    color: #3b82f6;
}

.bp-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bp-card ul li {
    font-size: 0.9rem;
    color: #475569;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.bp-card ul li:last-child {
    border-bottom: none;
}

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

.faq-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.faq-question {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #ffffff;
    transition: background 0.2s ease;
}

.faq-question:hover {
    background: #f8fafc;
}

.faq-question h3 {
    font-size: 1.05rem;
    color: #0f172a;
    margin: 0;
    font-weight: 600;
}

.faq-question i {
    color: #64748b;
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1.5rem;
    background: #f8fafc;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-item.active .faq-answer {
    padding: 1rem 1.5rem 1.25rem;
}

/* Call to Action */
.cta-section {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #ffffff;
    text-align: center;
    padding: 4.5rem 0;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #ffffff;
}

.cta-content p {
    font-size: 1.1rem;
    color: #cbd5e1;
    margin-bottom: 2rem;
}

.cta-content .btn-primary {
    font-size: 1.1rem;
    padding: 1rem 2.2rem;
    border-radius: 10px;
    background: #ffffff;
    color: #1e3a8a;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
}

.cta-content .btn-primary:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cta-note {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 1.75rem;
    }
    .perf-input-group {
        flex-direction: column;
    }
    .perf-score-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .perf-quick-stats {
        border-left: none;
        border-top: 1px solid #e2e8f0;
        padding-left: 0;
        padding-top: 1.2rem;
        justify-content: center;
    }
    .cwv-cards-grid {
        grid-template-columns: 1fr;
    }
}
