/* Fabrika Policy Generator - Frontend Styles (minimale/neutro) */

/* Reset per embed e standalone */
.fpg-policy-page {
    margin: 0;
    padding: 0;
    background: #fff;
    color: #222;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* Container principale */
.fpg-policy-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Header */
.fpg-policy-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e0e0e0;
}

.fpg-policy-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #111;
    line-height: 1.3;
}

.fpg-policy-subtitle {
    font-size: 15px;
    color: #555;
    margin: 0 0 4px;
}

.fpg-policy-subtitle a {
    color: #555;
    text-decoration: underline;
}

.fpg-policy-date {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* Selettore lingua */
.fpg-lang-switcher {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
}

.fpg-lang-btn {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: #555;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-right: none;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.fpg-lang-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.fpg-lang-btn:last-child {
    border-right: 1px solid #ddd;
    border-radius: 0 4px 4px 0;
}

.fpg-lang-btn:hover {
    background: #e8e8e8;
    color: #222;
}

.fpg-lang-btn.fpg-lang-active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Contenuto policy */
.fpg-policy-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 32px 0 12px;
    color: #111;
    line-height: 1.3;
}

.fpg-policy-content h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 24px 0 8px;
    color: #333;
}

.fpg-policy-content p {
    margin: 0 0 12px;
    color: #333;
}

.fpg-policy-content ul,
.fpg-policy-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.fpg-policy-content li {
    margin-bottom: 6px;
    color: #333;
}

.fpg-policy-content a {
    color: #1a6fb5;
    text-decoration: underline;
}

.fpg-policy-content a:hover {
    color: #0d4f82;
}

.fpg-policy-content strong {
    font-weight: 600;
    color: #111;
}

.fpg-policy-section {
    margin-bottom: 40px;
}

.fpg-policy-section:last-child {
    margin-bottom: 0;
}

.fpg-policy-section__header {
    margin-bottom: 20px;
}

.fpg-policy-section__eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.fpg-policy-section__title {
    margin: 0;
}

.fpg-policy-section__intro {
    margin: 10px 0 0;
    color: #555;
}

.fpg-clause {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.fpg-clause:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.fpg-policy-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.fpg-policy-group {
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fafafa;
}

.fpg-policy-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.fpg-policy-group__title {
    margin: 0;
}

.fpg-policy-group__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.fpg-policy-group__accordions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.fpg-service-accordion {
    border: 1px solid #d9dce3;
    border-radius: 14px;
    background: #fff;
    overflow: hidden; 
}

.fpg-service-accordion[open] {
    border-color: #c4cad6;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.fpg-service-accordion__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    color: #111827;
}

.fpg-service-accordion__summary::-webkit-details-marker {
    display: none;
}

.fpg-service-accordion__title {
    flex: 1;
}

.fpg-service-accordion__toggle {
    position: relative;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.fpg-service-accordion__toggle::before,
.fpg-service-accordion__toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #4b5563;
    transform: translate(-50%, -50%);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.fpg-service-accordion__toggle::before {
    width: 14px;
    height: 2px;
    border-radius: 999px;
}

.fpg-service-accordion__toggle::after {
    width: 2px;
    height: 14px;
    border-radius: 999px;
}

.fpg-service-accordion[open] .fpg-service-accordion__toggle::after {
    opacity: 0;
    transform: translate(-50%, -50%) scaleY(0);
}

.fpg-service-accordion__content {
    padding: 0 20px 20px;
    color: #374151;
    border-top: 1px solid #eef0f4;
}

.fpg-service-accordion__content > :first-child {
    margin-top: 16px;
}

.fpg-service-accordion__content > :last-child {
    margin-bottom: 0;
}

/* Footer */
.fpg-policy-footer {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.fpg-policy-footer p {
    font-size: 12px;
    color: #aaa;
    margin: 0;
}

.fpg-policy-footer a {
    color: #aaa;
    text-decoration: none;
}

.fpg-policy-footer a:hover {
    color: #666;
}

/* Responsive */
@media (max-width: 600px) {
    .fpg-policy-container {
        padding: 24px 16px;
    }

    .fpg-policy-header h1 {
        font-size: 22px;
    }

    .fpg-policy-content h2 {
        font-size: 18px;
    }

    .fpg-policy-content h3 {
        font-size: 16px;
    }

    .fpg-policy-group {
        padding: 16px;
        border-radius: 14px;
    }

    .fpg-policy-group__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .fpg-policy-group__accordions {
        grid-template-columns: 1fr;
    }

    .fpg-service-accordion__summary {
        padding: 16px;
    }

    .fpg-service-accordion__content {
        padding: 0 16px 16px;
    }
}

/* Print */
@media print {
    .fpg-policy-page {
        font-size: 12pt;
    }

    .fpg-policy-container {
        max-width: 100%;
        padding: 0;
    }

    .fpg-lang-switcher {
        display: none;
    }

    .fpg-policy-footer {
        display: none;
    }

    .fpg-policy-header {
        border-bottom-color: #000;
    }

    .fpg-policy-content a {
        color: #000;
        text-decoration: none;
    }

    .fpg-policy-content a::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #555;
    }

    .fpg-clause {
        page-break-inside: avoid;
    }

    .fpg-policy-group {
        border-color: #000;
        background: transparent;
        page-break-inside: avoid;
    }

    .fpg-policy-group__accordions {
        display: block;
    }

    .fpg-service-accordion {
        margin-bottom: 12px;
        border-color: #000;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .fpg-service-accordion > summary {
        padding: 0 0 8px;
    }

    .fpg-service-accordion > * {
        display: block !important;
    }

    .fpg-service-accordion__toggle {
        display: none;
    }

    .fpg-service-accordion__content {
        padding: 0;
        border-top: 0;
    }
}

/* === Tabella dettaglio cookie === */
.fpg-cookie-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
}
.fpg-cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 520px;
}
.fpg-cookie-table th,
.fpg-cookie-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid #e6e6e6;
    vertical-align: top;
}
.fpg-cookie-table thead th {
    background: #f5f6f7;
    font-weight: 600;
    border-bottom: 2px solid #d9dcdf;
    white-space: nowrap;
}
.fpg-cookie-table tbody tr:nth-child(even) {
    background: #fafbfc;
}
.fpg-cookie-table code {
    background: #eef1f4;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
}
.fpg-cookie-table__note {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    line-height: 1.5;
}

@media print {
    .fpg-cookie-table-wrap {
        overflow: visible;
    }
    .fpg-cookie-table {
        min-width: 0;
        font-size: 10pt;
        page-break-inside: auto;
    }
    .fpg-cookie-table thead th {
        background: transparent;
        border-bottom: 1.5pt solid #000;
    }
    .fpg-cookie-table tbody tr {
        page-break-inside: avoid;
    }
    .fpg-cookie-table code {
        background: transparent;
    }
}
