/* ====================
   LEGAL PAGES - EXPY
   Terms of Service & Privacy Policy
   ==================== */

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #2d3748;
  line-height: 1.6;
}

/* Container */
.legal-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  background: white;
  min-height: 100vh;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.1);
}

/* Header */
.legal-header {
  text-align: center;
  padding-bottom: 40px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 40px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 30px;
  transition: all 0.2s ease;
  padding: 8px 16px;
  border-radius: 8px;
}

.back-link:hover {
  background: #eef2ff;
  transform: translateX(-4px);
}

.back-link i {
  width: 18px;
  height: 18px;
}

.legal-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.legal-logo i {
  width: 48px;
  height: 48px;
  color: #667eea;
}

.legal-header h1 {
  font-size: 2.5rem;
  color: #1a202c;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.legal-subtitle {
  color: #718096;
  font-size: 0.95rem;
  margin-top: 8px;
}

/* Content */
.legal-content {
  padding: 0 20px;
}

.legal-section {
  margin-bottom: 48px;
}

.legal-section h2 {
  font-size: 1.8rem;
  color: #1a202c;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #edf2f7;
}

.legal-section h3 {
  font-size: 1.3rem;
  color: #2d3748;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 16px;
}

.legal-section h4 {
  font-size: 1.1rem;
  color: #4a5568;
  font-weight: 600;
  margin-bottom: 12px;
}

.legal-section p {
  margin-bottom: 16px;
  color: #4a5568;
  line-height: 1.8;
}

.legal-section ul,
.legal-section ol {
  margin-bottom: 20px;
  padding-left: 28px;
}

.legal-section li {
  margin-bottom: 12px;
  color: #4a5568;
  line-height: 1.7;
}

.legal-section li strong {
  color: #2d3748;
}

/* Definitions */
.legal-definitions {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.definition-item {
  padding: 16px 20px;
  background: #f7fafc;
  border-left: 4px solid #667eea;
  border-radius: 8px;
  font-size: 0.95rem;
}

.definition-item strong {
  color: #667eea;
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

/* Info Box */
.info-box {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 2px solid #c7d2fe;
  border-radius: 12px;
  margin: 24px 0;
}

.info-box i {
  width: 28px;
  height: 28px;
  color: #667eea;
  flex-shrink: 0;
  margin-top: 2px;
}

.info-box strong {
  display: block;
  color: #1a202c;
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.info-box p {
  margin: 0;
  color: #4c51bf;
  font-size: 0.95rem;
}

/* Warning Box */
.warning-box {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: 8px;
  margin: 20px 0;
}

.warning-box i {
  width: 24px;
  height: 24px;
  color: #d97706;
  flex-shrink: 0;
}

.warning-box strong {
  color: #92400e;
}

/* Note */
.note {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  border-radius: 6px;
  margin: 16px 0;
  font-size: 0.9rem;
}

.note i {
  width: 18px;
  height: 18px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Data Categories */
.data-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.data-category {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.data-category:hover {
  border-color: #667eea;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.data-category h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1a202c;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.data-category h4 i {
  width: 22px;
  height: 22px;
  color: #667eea;
}

.data-category ul {
  margin: 0;
  padding-left: 20px;
}

.data-category li {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

/* Usage Purposes */
.usage-purposes {
  display: grid;
  gap: 16px;
  margin: 24px 0;
}

.purpose-item {
  display: flex;
  gap: 16px;
  padding: 18px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  transition: all 0.2s ease;
}

.purpose-item:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.purpose-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.purpose-icon i {
  width: 24px;
  height: 24px;
  color: white;
}

.purpose-icon-blue {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.purpose-icon-purple {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
}

.purpose-icon-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.purpose-icon-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.purpose-icon-red {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.purpose-icon-cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.purpose-item h4 {
  margin: 0 0 6px 0;
  color: #1a202c;
  font-size: 1.05rem;
}

.purpose-item p {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

/* Legal Bases */
.legal-bases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.legal-basis {
  padding: 16px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  font-size: 0.92rem;
}

.legal-basis strong {
  display: block;
  color: #4c51bf;
  margin-bottom: 6px;
}

/* Pricing Info */
.pricing-info {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.pricing-tier {
  padding: 14px 18px;
  background: #f0fdf4;
  border-left: 4px solid #10b981;
  border-radius: 8px;
  font-size: 0.95rem;
}

.pricing-tier strong {
  color: #047857;
}

/* Security Measures */
.security-measures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.security-item {
  text-align: center;
  padding: 24px 16px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.security-item:hover {
  border-color: #10b981;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.15);
  transform: translateY(-4px);
}

.security-item i {
  width: 40px;
  height: 40px;
  color: #10b981;
  margin-bottom: 12px;
}

.security-item h4 {
  color: #1a202c;
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.security-item p {
  margin: 0;
  font-size: 0.88rem;
  color: #64748b;
}

/* Cookie Types */
.cookie-types {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.cookie-type {
  padding: 18px 20px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
}

.cookie-type h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: #1a202c;
}

.cookie-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.cookie-required {
  background: #fef2f2;
  color: #dc2626;
}

.cookie-optional {
  background: #f0fdf4;
  color: #059669;
}

.cookie-type p {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
}

/* User Rights */
.user-rights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.right-item {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.right-item:hover {
  background: white;
  border-color: #667eea;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.12);
}

/* Il selettore deve prendere anche l'`svg`: lucide SOSTITUISCE l'`<i data-lucide>` con un
   `<svg>`, quindi questa regola (misura fissa e niente restringimento) non arrivava a nessuna
   icona e il flex le schiacciava in proporzione a quanto testo c'era accanto. Misurato il
   21/09/2026 a 375px: le icone stavano fra 18 e 19px invece di 24, e la voce «Decisioni
   automatizzate», che ha il paragrafo più lungo, scendeva a 6px. */
.right-item i,
.right-item > svg {
  width: 24px;
  height: 24px;
  color: #667eea;
  flex-shrink: 0;
  margin-top: 2px;
}

.right-item h4 {
  margin: 0 0 4px 0;
  color: #1a202c;
  font-size: 0.98rem;
}

.right-item p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
}

/* Contact Info */
.contact-info {
  display: grid;
  gap: 12px;
  margin: 20px 0;
  padding: 20px;
  background: #f0fdf4;
  border-radius: 10px;
  border: 2px solid #d1fae5;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
}

/* Stessa ragione di `.right-item`: lucide sostituisce l'`<i>` con un `<svg>`. Qui serve anche
   `flex-shrink: 0`, altrimenti la riga più lunga (la segnalazione sull'assistente IA) schiaccia
   la sua icona. */
.contact-item i,
.contact-item > svg {
  width: 20px;
  height: 20px;
  color: #059669;
  flex-shrink: 0;
}

.contact-item span {
  color: #065f46;
}

/* Authority Info */
.authority-info {
  padding: 20px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  margin: 20px 0;
}

.authority-info h4 {
  color: #1a202c;
  margin-bottom: 12px;
}

.authority-info p {
  margin: 6px 0;
  font-size: 0.92rem;
}

.authority-info a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.authority-info a:hover {
  text-decoration: underline;
}

/* Acknowledgment */
.legal-acknowledgment {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 3px solid #edf2f7;
}

.acknowledgment-box {
  display: flex;
  gap: 20px;
  padding: 28px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 2px solid #c7d2fe;
  border-radius: 16px;
}

.acknowledgment-box i {
  width: 36px;
  height: 36px;
  color: #667eea;
  flex-shrink: 0;
  margin-top: 4px;
}

.acknowledgment-box h3 {
  margin: 0 0 12px 0;
  color: #1a202c;
  font-size: 1.3rem;
}

.acknowledgment-box p {
  margin: 8px 0;
  color: #4c51bf;
  font-size: 0.98rem;
  line-height: 1.7;
}

/* Footer */
.legal-footer {
  margin-top: 60px;
  padding-top: 32px;
  border-top: 2px solid #e2e8f0;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #764ba2;
  text-decoration: underline;
}

.legal-footer p {
  color: #718096;
  font-size: 0.9rem;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .legal-container {
    padding: 24px 16px;
  }

  .legal-content {
    padding: 0 8px;
  }

  .legal-header h1 {
    font-size: 2rem;
  }

  .legal-section h2 {
    font-size: 1.5rem;
  }

  .legal-section h3 {
    font-size: 1.2rem;
  }

  .data-categories,
  .usage-purposes,
  .security-measures,
  .user-rights {
    grid-template-columns: 1fr;
  }

  .info-box,
  .acknowledgment-box {
    flex-direction: column;
    gap: 12px;
  }

  .footer-links {
    flex-direction: column;
    gap: 12px;
  }
}

/* Print Styles */
@media print {
  .back-link,
  .legal-footer {
    display: none;
  }

  .legal-container {
    box-shadow: none;
    padding: 0;
  }

  .legal-section {
    page-break-inside: avoid;
  }
}
