/* ── Google Fonts ────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ══════════════════════════════════════════════════
   LIGHT THEME (default)
══════════════════════════════════════════════════ */
:root {
  --c-bg: #f5f7fa;
  --c-surface: #ffffff;
  --c-surface-2: #f0f2f5;
  --c-surface-3: #e7e7e7;
  --c-border: rgba(0, 0, 0, 0.08);
  --c-border-2: rgba(0, 0, 0, 0.13);

  --c-teal: #21808d;
  --c-teal-dim: #1a6a76;
  --c-teal-light: #e8f6f8;
  --c-teal-glow: rgba(33, 128, 141, 0.15);
  --c-teal-muted: rgba(33, 128, 141, 0.08);

  --c-text: #1a2433;
  --c-text-2: #5a6a7a;
  --c-text-3: #a0adb8;

  --c-user-bg: #e8f6f8;
  --c-user-text: #0d4a52;
  --c-success: #10b981;
  --c-danger: #ef4444;
  --c-warning: #f59e0b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(33, 128, 141, 0.18);

  --sp-xs: 0.25rem;
  --sp-sm: 0.5rem;
  --sp-md: 1rem;
  --sp-lg: 1.5rem;
  --sp-xl: 2rem;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 9999px;
  --font: 'Inter', -apple-system, sans-serif;
  --duration: 200ms;
}

/* ══════════════════════════════════════════════════
   DARK THEME
══════════════════════════════════════════════════ */
[data-theme="dark"] {
  --c-bg: #0d1117;
  --c-surface: #161b22;
  --c-surface-2: #1c2330;
  --c-surface-3: #2d333c;
  --c-border: rgba(255, 255, 255, 0.08);
  --c-border-2: rgba(255, 255, 255, 0.14);

  --c-teal: #60adb9;
  --c-teal-dim: #2a838f;
  --c-teal-light: rgba(42, 181, 199, 0.12);
  --c-teal-glow: rgba(42, 181, 199, 0.22);
  --c-teal-muted: rgba(42, 181, 199, 0.08);

  --c-text: #e6edf3;
  --c-text-2: #8b949e;
  --c-text-3: #484f58;

  --c-user-bg: #21262d;
  --c-user-text: #e6edf3;
  --c-success: #3fb950;
  --c-danger: #f85149;
  --c-warning: #e3b341;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(42, 181, 199, 0.25);
}

/* ── Reset ───────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  transition: color-scheme var(--duration) ease;
}

body {
  font-family: var(--font);
  background: var(--c-surface);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background var(--duration) ease, color var(--duration) ease;
}

/* ── Layout ──────────────────────────────────────── */
.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0 auto;
  background: var(--c-surface);
  position: relative;
  transition: background var(--duration) ease, border-color var(--duration) ease;
}

/* ── Header ──────────────────────────────────────── */
.chat-header {
  background: linear-gradient(135deg, var(--c-teal-dim) 0%, var(--c-teal) 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: var(--sp-md) var(--sp-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 10;
}

[data-theme="dark"] .chat-header {
  background: linear-gradient(135deg, #0d2b33 0%, #0d1117 100%);
  border-bottom: 1px solid var(--c-border);
}

[data-theme="dark"] .chat-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-teal), transparent);
  opacity: 0.5;
}

.header-info {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  flex: 1;
}

.header-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-title h1 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}

[data-theme="dark"] .header-title h1 {
  background: linear-gradient(135deg, #fff 0%, var(--c-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  margin-right: var(--sp-md);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-text-3); /* Default grigio */
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--c-success);
  box-shadow: 0 0 8px var(--c-success);
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background: var(--c-danger);
}

.status-dot.connecting {
  background: var(--c-warning);
  animation: pulse 1s infinite;
}

.mode-badge {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 2px 10px;
  border-radius: var(--r-full);
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

[data-theme="dark"] .mode-badge {
  background: rgba(42, 181, 199, 0.12);
  border-color: rgba(42, 181, 199, 0.25);
  color: var(--c-text);
}

/* ── Theme toggle button ─────────────────────────── */
.theme-toggle {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--r-full);
  padding: 5px 10px;
  cursor: pointer;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--duration) ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
}

[data-theme="dark"] .theme-toggle {
  background: rgba(42, 181, 199, 0.12);
  border-color: rgba(42, 181, 199, 0.25);
  color: var(--c-text);
}

/* ── Chat area ───────────────────────────────────── */
.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--c-bg);
  transition: background var(--duration) ease;
}

[data-theme="dark"] .chat-container {
  background-image: radial-gradient(ellipse at 20% 10%, rgba(42, 181, 199, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(42, 181, 199, 0.03) 0%, transparent 50%);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-lg);
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--c-border-2);
  border-radius: 4px;
}

/* ── Messages ────────────────────────────────────── */
.message {
  display: flex;
  animation: msgIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-content {
  max-width: 78%;
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--r-xl);
  word-wrap: break-word;
  line-height: 1.6;
  font-size: 0.9rem;
  position: relative;
  transition: border-color var(--duration) ease, box-shadow var(--duration) ease;
}

.message.user .message-content {
  background: linear-gradient(135deg, var(--c-teal-dim), var(--c-teal));
  color: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-bottom-right-radius: var(--r-sm);
  box-shadow: 0 4px 14px rgba(33, 128, 141, 0.25);
}

.message.assistant .message-content {
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  color: var(--c-text);
  border-bottom-left-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}

.message.assistant .message-content:hover {
  border-color: var(--c-teal);
  box-shadow: 0 0 0 1px var(--c-teal-glow), var(--shadow-sm);
}

.message.error .message-content {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: var(--r-lg);
}

[data-theme="dark"] .message.error .message-content {
  color: #fca5a5;
}

.message.user .message-content a {
  color: var(--c-surface);
}

.message.assistant .message-content a {
  color: var(--c-text);
}

.message-content li {
  margin-left: 20px;
}

.message-content p {
  margin-bottom: 0.5em;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content strong {
  font-weight: 600;
}

.message-content code {
  background: var(--c-teal-muted);
  border: 1px solid var(--c-teal-glow);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

.message-time {
  font-size: 0.68rem;
  opacity: 0.55;
  margin-top: var(--sp-sm);
  text-align: right;
}

.message.assistant .message-time {
  text-align: left;
}

/* ── Quick options ───────────────────────────────── */
.quick-options {
  padding: var(--sp-sm) var(--sp-lg) var(--sp-md);
}

.quick-options-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-sm);
}

.quick-option {
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-full);
  padding: 7px 18px;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--c-text);
  font-family: var(--font);
  transition: all var(--duration) ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.quick-option:hover {
  background: var(--c-teal-muted);
  border-color: var(--c-teal);
  color: var(--c-teal);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.quick-option.selected {
  background: var(--c-teal);
  border-color: var(--c-teal);
  color: #fff;
  box-shadow: 0 2px 10px var(--c-teal-glow);
}

/* ── Typing indicator ────────────────────────────── */
.typing-indicator {
  padding: 0 var(--sp-lg) var(--sp-md);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
}

.typing-indicator:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

.typing-content {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}

.typing-avatar {
  font-size: 1.3rem;
}

.typing-bubbles {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-teal);
  animation: bounce 1.4s infinite ease-in-out;
  opacity: 0.7;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(-5px);
  }
}

/* ── Input area ──────────────────────────────────── */
.chat-input-container {
  background: var(--c-surface-3);
  border-top: 1px solid var(--c-border);
  padding: var(--sp-md) var(--sp-lg);
  transition: background var(--duration) ease;
}

.input-group {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-icon {
  display: none; /* Rimosso come richiesto */
}

.hidden {
  display: none !important;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.chat-input {
  width: 100%;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border-2);
  border-radius: var(--r-lg);
  padding: 12px 52px 12px 16px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--c-text);
  line-height: 1.5;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  transition: all var(--duration) ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--c-teal);
  box-shadow: 0 0 0 3px var(--c-teal-muted);
  background: var(--c-surface);
}

.chat-input::placeholder {
  color: var(--c-text-2);
}

.char-counter {
  position: absolute;
  right: 14px;
  bottom: 10px;
  font-size: 0.7rem;
  color: var(--c-text-3);
  pointer-events: none;
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-teal-dim), var(--c-teal));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: all var(--duration) ease;
  box-shadow: 0 2px 10px var(--c-teal-glow);
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 4px 18px var(--c-teal-glow);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.input-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--c-text-2);
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-sm);
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--duration) ease;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn--primary {
  background: linear-gradient(180deg, var(--c-teal-dim), var(--c-teal));
  color: #fff;
  box-shadow: 0 2px 10px var(--c-teal-glow);
}

.btn--primary:hover:not(:disabled) {
  box-shadow: 0 4px 18px var(--c-teal-glow);
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--c-surface-2);
  color: var(--c-text-2);
  border-color: var(--c-border-2);
}

.btn--secondary:hover {
  background: var(--c-surface);
  color: var(--c-text);
}

.btn--danger {
  background: #ef4444;
  border: 1px solid #dc2626;
  color: #fff;
}

.btn--danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn--outline {
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.25);
  font-size: 0.78rem;
}

.btn--outline:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn--sm {
  padding: 5px 10px;
  font-size: 0.75rem;
}

/* ── Completion message ──────────────────────────── */
.completion-message {
  animation: msgIn 0.5s ease-out;
}

.completion-content {
  background: var(--c-surface);
  border: 1px solid var(--c-teal);
  border-radius: var(--r-xl);
  padding: var(--sp-xl);
  max-width: 85%;
  box-shadow: var(--shadow-md), 0 0 30px var(--c-teal-glow);
}

.completion-content h3 {
  color: var(--c-teal);
  margin-bottom: var(--sp-sm);
  font-size: 1rem;
}

.completion-content p {
  color: var(--c-text-2);
  margin-bottom: var(--sp-lg);
  font-size: 0.875rem;
}

.quote-preview {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-md) var(--sp-lg);
  margin-top: var(--sp-md);
}

.quote-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.quote-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.quote-total {
  color: var(--c-teal);
  font-weight: 700;
  font-size: 1.05rem;
}

.quote-details {
  font-size: 0.82rem;
  color: var(--c-text-2);
  margin-bottom: var(--sp-md);
}

/* ── Modal ───────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.modal.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}

.modal-content {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  max-width: 92vw;
  max-height: 90vh;
  width: 720px;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-md) var(--sp-lg);
  border-bottom: 1px solid var(--c-border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--c-text-2);
  font-size: 1.4rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: all var(--duration) ease;
}

.modal-close:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}

.modal-body {
  flex: 1;
  padding: var(--sp-lg);
  overflow-y: auto;
}

.modal-body::-webkit-scrollbar {
  width: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: var(--c-border-2);
  border-radius: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg);
  border-top: 1px solid var(--c-border);
}

/* ── Quote sections ──────────────────────────────── */
.quote-section {
  margin-bottom: var(--sp-lg);
  page-break-inside: avoid;
  break-inside: avoid;
}

.quote-header,
.quote-info-item,
.price-breakdown,
.price-item,
.incentives-list li {
  page-break-inside: avoid;
  break-inside: avoid;
}

.quote-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--c-border);
}

.quote-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  background: #ffffff;
  border-radius: 5px;
  padding: 5px;
}

.quote-logo-image {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  overflow: hidden;
}

.quote-logo-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.quote-company {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--c-text);
}

.quote-company-subtitle {
  font-size: 0.9rem;
  color: var(--c-text-2);
}

.quote-meta {
  display: grid;
  gap: 0.3rem;
  color: var(--c-text-2);
  font-size: 0.95rem;
}

.quote-meta-item strong {
  color: var(--c-text);
}

.quote-section-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-teal);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-sm);
  border-bottom: 1px solid var(--c-border);
}

.quote-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.quote-info-item {
  background: var(--c-surface-2);
  padding: var(--sp-md);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
}

.notes-section {
  width: 100%;
  margin-bottom: var(--sp-md);
}

.quote-info-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--c-text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.quote-info-value {
  font-size: 0.9rem;
  color: var(--c-text);
  font-weight: 500;
}

.price-breakdown {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.price-breakdown-header {
  background: var(--c-teal-light);
  padding: 10px var(--sp-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c-teal);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--c-border);
}

[data-theme="dark"] .price-breakdown-header {
  background: linear-gradient(135deg, rgba(42, 181, 199, 0.15), rgba(42, 181, 199, 0.05));
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px var(--sp-md);
  border-bottom: 1px solid var(--c-border);
  gap: var(--sp-md);
}

.price-item:last-child {
  border-bottom: none;
  background: var(--c-teal-light);
}

[data-theme="dark"] .price-item:last-child {
  background: rgba(42, 181, 199, 0.06);
}

.price-label {
  color: var(--c-text-2);
  font-size: 0.85rem;
}

.price-label strong {
  color: var(--c-text);
}

.price-value {
  color: var(--c-teal);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.incentives-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.incentives-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px var(--sp-md);
}

.incentive-name {
  font-size: 0.87rem;
  color: var(--c-text);
}

.incentive-value {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--c-success);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--r-full);
}

/* ── Utility ─────────────────────────────────────── */
.hidden {
  display: none !important;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

/* ── AI Narrative ─────────────────────────────────── */
.ai-narrative {
  background: var(--c-teal-light);
  border: 1px solid rgba(33, 128, 141, 0.25);
  border-left: 3px solid var(--c-teal);
  border-radius: var(--r-md);
  padding: var(--sp-md) var(--sp-lg);
  font-size: 0.88rem;
  color: var(--c-text);
  line-height: 1.7;
  margin-bottom: var(--sp-lg);
  font-style: italic;
}

[data-theme="dark"] .ai-narrative {
  background: rgba(42, 181, 199, 0.06);
  border-color: rgba(42, 181, 199, 0.2);
  color: var(--c-text-2);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 640px) {
  .container {
    border: none;
    max-width: 100%;
  }

  .message-content {
    max-width: 90%;
  }

  .modal-content {
    max-width: 98vw;
    border-radius: var(--r-lg);
  }

  .quote-info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .header-title h1 {
    font-size: 1.1rem;
  }
}

/* Stili per Date Picker Nativo (Miglioramenti cross-browser) */
#datePicker {
  /* Posizionamento centrale invisibile */
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  width: 0;
  height: 0;
}

/* Tentativo di migliorare l'estetica del calendario nativo su Chrome/Edge */
::-webkit-calendar-picker-indicator {
  background: var(--c-teal);
  padding: 5px;
  cursor: pointer;
  border-radius: 3px;
  filter: invert(0.8);
}

/* ══════════════════════════════════════════════════
   PRIVACY FOOTER
══════════════════════════════════════════════════ */
.privacy-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  background: var(--c-surface-2);
  border-top: 1px solid var(--c-border);
  font-size: 0.7rem;
  color: var(--c-text-3);
  text-align: center;
  justify-content: center;
  flex-wrap: wrap;
}

.privacy-footer a {
  color: var(--c-teal);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.privacy-footer a:hover {
  text-decoration: underline;
}

/* ══════════════════════════════════════════════════
   CONSENT CHECKBOX
══════════════════════════════════════════════════ */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--c-text);
  line-height: 1.5;
}

.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--c-teal);
  cursor: pointer;
}

.consent-label span {
  color: var(--c-text-2);
}