/* Page 03 Home. Tokens: FigCraft Foundations 8046; source patterns: Components 8979. */
body.home-page {
  --color-bg: #090a13;
  --color-surface: #121425;
  --color-surface-2: #0e101d;
  --home-card: #16192e;
  --color-text: #f2f5ff;
  --color-text-muted: #b8bfda;
  --color-text-faint: #949cbf;
  --color-primary: #7d45fa;
  --color-primary-hover: #6936e8;
  --color-primary-subtle: #211d3a;
  --color-accent: #2bd1f5;
  --color-blue: #2e78ff;
  --color-border: #2e3357;
  --color-border-emphasis: #454f80;
  --color-divider: var(--color-border);
  --color-success: #3bd18f;
  --color-warning: #fabf42;
  --color-error: #f75473;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 24px;
  --font-body: Inter, sans-serif;
  --font-display: Inter, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  color-scheme: dark;
  font: 400 14px/1.5 Inter, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}
body.home-page[data-theme="light"] {
  --color-bg: #f7faff;
  --color-surface: #fff;
  --color-surface-2: #eef2ff;
  --home-card: #f2f5ff;
  --color-text: #1a1f33;
  --color-text-muted: #4d5878;
  --color-text-faint: #6b7596;
  --color-primary-subtle: #eef2ff;
  --color-border: #d6dcf1;
  --color-border-emphasis: #aeb9db;
  color-scheme: light;
}
.home-page::before, .home-page::after { display: none; }
.home-page .page-wrapper { min-height: 100vh; }
.home-page #main-content { display: block; width: 100%; }
.home-page .copy-mobile { display: none; }
.home-page .section-inner { width: 100%; max-width: 1312px; margin: auto; }
.home-page .section-title { margin: 0 0 8px; font: 700 32px/40px Inter, sans-serif; letter-spacing: 0; text-wrap: wrap; }
.home-page .section-sub { max-width: none; margin: 0 0 32px; color: var(--color-text-muted); font: 400 16px/24px Inter, sans-serif; }
.home-page :is(a,button,summary,input):focus-visible { outline: 2px solid var(--color-blue); outline-offset: 4px; }
.home-page .btn { min-height: 44px; padding: 12px 24px; font: 500 14px/20px Inter, sans-serif; border-radius: 12px !important; display: inline-flex; justify-content: center; align-items: center; gap: 8px; }
/* These declarations override the legacy shared .btn !important skin. */
.home-page .btn-primary, .home-page .btn-hero-primary { background: linear-gradient(90deg,#7d45fa,#2e78ff) !important; border: 0; color: #fff; }
.home-page .btn-primary:hover, .home-page .btn-hero-primary:hover { background: linear-gradient(90deg,#a478ff,#67a2ff) !important; filter: none; }
.home-page .btn-primary:active, .home-page .btn-hero-primary:active { opacity: .82; }
.home-page .btn-primary:disabled { background: var(--home-card) !important; opacity: .68; cursor: default; }
.home-page .btn-secondary, .home-page .btn-hero-discord { background: var(--color-surface) !important; color: var(--color-text) !important; border: 1px solid var(--color-border); }
.home-page .btn-icon { width: 20px; height: 20px; flex: 0 0 20px; }
.home-page .hero { display: block; margin: 32px auto 40px; padding: 44px 32px 116px; max-width: 1312px; }
.home-page .hero-inner { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,560px); gap: 80px; padding-right: 32px; align-items: start; text-align: left; }
.home-page .hero-copy { padding-top: 22px; }
.home-page .hero-accent { width: 72px; height: 6px; background: var(--color-primary); border-radius: 999px; margin-bottom: 24px; }
.home-page #heroTitle { margin: 0 0 14px; font: 700 64px/72px Inter, sans-serif; letter-spacing: 0; }
.home-page .hero-subtitle { max-width: 430px; margin: 0 0 38px; font: 400 18px/28px Inter, sans-serif; color: var(--color-text-muted); }
.home-page .hero-actions { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.home-page .hero-actions .btn-icon { display: none; }
.home-page .hero-availability { margin: 30px 0 0; color: var(--color-text-faint); font-size: 13px; line-height: 18px; }
.home-page .hero-terminal { min-width: 0; min-height: 500px; display: flex; flex-direction: column; padding: 26px; background: var(--home-card); border: 1px solid var(--color-border); border-radius: 24px; }
.home-page .terminal-title { color: var(--color-accent); text-transform: uppercase; font-size: 12px; line-height: 18px; font-weight: 600; }
.home-page .terminal-context { margin: 8px 0 36px; color: var(--color-text-faint); font-size: 13px; line-height: 20px; }
.home-page .terminal-body { display: grid; gap: 20px; }
.home-page .terminal-line { background: var(--color-surface-2); border-radius: 16px; padding: 16px 20px; }
.home-page[data-theme="light"] .terminal-line { background: var(--color-surface); }
.home-page .t-user, .home-page .t-bot { display: block; font-size: 12px; line-height: 18px; font-weight: 600; margin-bottom: 8px; }
.home-page .t-user { color: var(--color-blue); }
.home-page .t-bot { color: var(--color-primary); }
.home-page .t-text { font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.home-page .terminal-body .terminal-line:last-child { min-height: 150px; }
.home-page .terminal-line-providers { margin: auto 0 24px; padding-top: 24px; color: var(--color-text-faint); font-size: 12px; line-height: 18px; }
.home-page .cursor-blink { display: inline-block; width: 1px; height: 1em; background: currentColor; animation: home-cursor 1s step-end infinite; }
@keyframes home-cursor { 50% { opacity: 0; } }
.home-page .stats-section { max-width: 1312px; margin: 0 auto; padding: 0; }
.home-page .stats-grid { min-height: 140px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--color-border); border-radius: 20px; background: var(--color-surface); padding: 28px 0; text-align: center; }
.home-page .stat-item { min-width: 0; padding: 0 16px; display: grid; align-content: center; justify-items: center; gap: 8px; }
.home-page .stat-item + .stat-item { border-left: 1px solid var(--color-border); }
.home-page .stat-number { font: 700 28px/36px Inter, sans-serif; min-width: 72px; min-height: 36px; color: var(--color-blue); }
.home-page .stat-item:nth-child(3) .stat-number { color: var(--color-accent); }
.home-page .stat-item:nth-child(4) .stat-number { color: var(--color-success); }
.home-page .stat-label { color: var(--color-text-muted); font: 500 13px/18px Inter, sans-serif; }
.home-page .features, .home-page .blog-section, .home-page .pages-section { padding: 0; width: calc(100% - 128px); max-width: 1312px; margin: 80px auto 0; }
.home-page .features-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 32px; }
.home-page .blog-grid, .home-page .pages-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.home-page .feature-card, .home-page .blog-card, .home-page .page-card { min-width: 0; padding: 24px; border: 1px solid var(--color-border); border-radius: 16px; background: var(--home-card); }
.home-page .card-accent { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--color-primary); margin-bottom: 16px; }
.home-page .feature-tag, .home-page .blog-tag { display: block; color: var(--color-primary); font: 600 11px/16px Inter, sans-serif; margin: 0 0 12px; }
.home-page .feature-title, .home-page .page-card-title { font: 600 18px/24px Inter, sans-serif; margin: 0 0 12px; }
.home-page .feature-desc { color: var(--color-text-muted); font: 400 13px/18px Inter, sans-serif; margin: 0; }
.home-page .feature-card:nth-child(even) .card-accent, .home-page .blog-card:nth-child(even) .card-accent { background: var(--color-blue); }
.home-page .feature-card:nth-child(even) .feature-tag { color: var(--color-blue); }
.home-page .blog-card { display: flex; flex-direction: column; min-height: 260px; }
.home-page .blog-card .card-accent { width: 48px; margin-bottom: 18px; }
.home-page .blog-card-title { font: 600 19px/26px Inter, sans-serif; margin: 4px 0 16px; }
.home-page .blog-card-excerpt, .home-page .page-card-desc { color: var(--color-text-muted); font: 400 14px/20px Inter, sans-serif; margin: 0 0 20px; }
.home-page .card-action { display: inline-block; color: var(--color-primary); font: 600 13px/18px Inter,sans-serif; text-decoration: none; }
.home-page .blog-card .card-action { color: var(--color-accent); margin-top: auto; min-height: 44px; display: flex; align-items: end; }
.home-page .page-card-link { display: block; color: inherit; text-decoration: none; }
.home-page .page-card { background: var(--color-surface); min-height: 164px; height: 100%; display: flex; flex-direction: column; }
.home-page .page-card .card-action { margin-top: auto; }
.home-page .page-card-link:nth-child(3n+2) .card-action { color: var(--color-blue); }
.home-page .cta-section { max-width: 1312px; width: calc(100% - 128px); margin: 112px auto 0; }
.home-page .cta-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "accent ." "title action" "body action" "support ."; gap: 14px 40px; padding: 40px; background: var(--home-card); border: 1px solid var(--color-border-emphasis); border-radius: 24px; }
.home-page .cta-accent { grid-area: accent; width: 64px; height: 6px; border-radius: 3px; background: var(--color-primary); margin-bottom: 22px; }
.home-page #ctaTitle { grid-area: title; font: 700 40px/48px Inter,sans-serif; margin: 0; }
.home-page .cta-description { grid-area: body; color: var(--color-text-muted); font: 400 17px/26px Inter,sans-serif; margin: 0; }
.home-page .cta-support { grid-area: support; color: var(--color-text-faint); font: 500 13px/18px Inter,sans-serif; margin: 32px 0 24px; }
.home-page .home-start { grid-area: action; align-self: center; margin-right: 48px; }
.home-page .home-faq { max-width: 1312px; width: calc(100% - 128px); margin: 48px auto 0; }
.home-page .home-faq-inner { padding: 32px 40px 40px; background: var(--home-card); border: 1px solid var(--color-border-emphasis); border-radius: 20px; }
.home-page[data-theme="light"] .home-faq-inner { background: var(--color-surface); }
.home-page .home-faq-inner::before { content: ""; display: block; width: 56px; height: 5px; border-radius: 3px; background: var(--color-primary); margin-bottom: 23px; }
.home-page .home-faq h2 { font: 700 24px/30px Inter,sans-serif; margin: 0 0 6px; }
.home-page .home-faq-inner > p { font: 400 13px/20px Inter,sans-serif; color: var(--color-text-muted); margin: 0 0 12px; }
.home-page .home-faq-list { display: grid; gap: 4px; }
.home-page .home-faq details { padding: 16px 20px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 14px; }
.home-page .home-faq summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; cursor: pointer; font: 600 14px/20px Inter,sans-serif; min-height: 44px; }
.home-page .home-faq summary::-webkit-details-marker { display: none; }
.home-page .home-faq summary::after { content: "+"; color: var(--color-primary); font-size: 20px; }
.home-page .home-faq details[open] summary::after { content: "−"; }
.home-page .home-faq details p { color: var(--color-text-muted); margin: 4px 36px 0 0; font: 400 13px/18px Inter,sans-serif; }
.home-page .image-unavailable { visibility: hidden; }
.home-page #statMsgDay[aria-busy="true"] { position: relative; }
.home-page #statMsgDay[aria-busy="true"]::after { content: ""; position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(100deg,var(--home-card) 20%,var(--color-border) 50%,var(--home-card) 80%); background-size: 200% 100%; animation: home-loading 1.4s ease-in-out infinite; }
@keyframes home-loading { to { background-position: -200% 0; } }
/* A consent banner occupies document space, so it cannot cover a card or control. */
.home-page .cookie-banner { position: relative; inset: auto; transform: none; margin: 24px auto; width: calc(100% - 32px); max-width: 1312px; visibility: visible; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; padding: 20px; box-shadow: none; }
.home-page .cookie-banner:not(.visible) { display: none; }
.home-page .cookie-inner { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.home-page .cookie-text { flex: 1; min-width: 220px; }
.home-page .cookie-text p { color: var(--color-text-muted); }
.home-page .cookie-actions { display: flex; gap: 12px; }
.home-page .cookie-actions button { min-height: 44px; border-radius: 12px; padding: 10px 20px; }
.home-page .cookie-float-btn { position: static; margin: 16px auto; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
@media (max-width: 1100px) {
  .home-page #main-content { padding-inline: 0 !important; }
  .home-page .hero { margin-top: 16px; padding: 22px 16px 24px; width: calc(100% - 32px); }
  .home-page .hero-inner { grid-template-columns: minmax(0,1fr); max-width: 600px; margin: auto; gap: 28px; padding-right: 0; }
  .home-page .hero-copy { padding-top: 0; }
  .home-page .hero-accent { width: 64px; height: 5px; margin-bottom: 25px; }
  .home-page #heroTitle { font-size: 42px; line-height: 48px; margin-bottom: 28px; }
  .home-page .hero-subtitle { font-size: 16px; line-height: 24px; max-width: none; margin-bottom: 26px; }
  .home-page .hero-actions { display: grid; gap: 12px; }
  .home-page .hero-actions .btn { width: 100%; }
  .home-page .hero-availability { margin-top: 16px; font-size: 12px; line-height: 16px; }
  .home-page .hero-terminal { min-height: 214px; padding: 16px; border-radius: 16px; }
  .home-page .terminal-context { display: none; }
  .home-page .terminal-title { font-size: 10px; line-height: 14px; }
  .home-page .terminal-body { gap: 8px; margin-top: 12px; }
  .home-page .terminal-line { padding: 8px 12px; border-radius: 12px; }
  .home-page .t-user, .home-page .t-bot { font-size: 10px; line-height: 14px; margin-bottom: 2px; }
  .home-page .t-text { font-size: 13px; line-height: 18px; }
  .home-page .terminal-body .terminal-line:last-child { min-height: 58px; }
  .home-page .terminal-line-providers { font-size: 10px; line-height: 14px; margin: 8px 0 0; padding: 0; }
  .home-page .stats-section { width: calc(100% - 32px); margin-top: 40px; }
  .home-page .features, .home-page .blog-section, .home-page .pages-section { width: calc(100% - 64px); }
  .home-page .features-grid, .home-page .blog-grid, .home-page .pages-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
  .home-page .cta-section, .home-page .home-faq { width: calc(100% - 64px); }
  .home-page .home-start { margin-right: 0; }
}
@media (max-width: 600px) {
  /* Narrow exceptions to global mobile !important rules in style.css. */
  .home-page .section-title { font-size: 26px !important; }
  .home-page #ctaTitle { font-size: 27px !important; }
  .home-page .home-faq h2 { font-size: 24px !important; }
  .home-page .copy-desktop { display: none; }
  .home-page .copy-mobile { display: inline; }
  .home-page .section-title { font-size: 26px; line-height: 34px; }
  .home-page .section-sub { font-size: 14px; line-height: 20px; margin-bottom: 24px; }
  .home-page .features, .home-page .blog-section, .home-page .pages-section { width: calc(100% - 32px); }
  .home-page .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 16px; gap: 0; border-radius: 18px; }
  .home-page .stat-item { padding: 8px; }
  .home-page .stat-item:nth-child(3) { border-left: 0; }
  .home-page .stat-item:nth-child(n+3) { border-top: 1px solid var(--color-border); padding-top: 16px; margin-top: 12px; }
  .home-page .stat-number { font-size: 24px; line-height: 30px; min-height: 30px; }
  .home-page .stat-label { font-size: 12px; line-height: 16px; }
  .home-page .features-grid, .home-page .blog-grid, .home-page .pages-grid { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .home-page .feature-card, .home-page .blog-card { padding: 20px; }
  .home-page .feature-title { font-size: 17px; line-height: 22px; }
  .home-page .feature-tag, .home-page .blog-tag { font-size: 10px; line-height: 14px; }
  .home-page .feature-desc { font-size: 13px; line-height: 17px; }
  .home-page .blog-card { min-height: 220px; }
  .home-page .blog-card-title { font-size: 17px; line-height: 22px; }
  .home-page .blog-card-excerpt { font-size: 13px; line-height: 18px; }
  .home-page .page-card { min-height: 130px; padding: 18px 20px; }
  .home-page .page-card-title { font-size: 16px; line-height: 21px; }
  .home-page .page-card-desc { font-size: 13px; line-height: 18px; margin-bottom: 15px; }
  .home-page .cta-section { width: calc(100% - 32px); margin-top: 50px; }
  .home-page .cta-inner { padding: 20px; border-radius: 20px; grid-template-columns: 1fr; grid-template-areas: "accent" "title" "body" "support" "action"; gap: 10px; }
  .home-page .cta-accent { margin-bottom: 18px; width: 56px; height: 5px; }
  .home-page #ctaTitle { font-size: 27px; line-height: 34px; }
  .home-page .cta-description { font-size: 14px; line-height: 20px; }
  .home-page .cta-support { font-size: 12px; line-height: 16px; margin: 0 0 10px; }
  .home-page .home-faq { width: calc(100% - 32px); margin-top: 24px; }
  .home-page .home-faq-inner { padding: 24px 16px; }
  .home-page .home-faq h2 { font-size: 24px; line-height: 30px; }
  .home-page .home-faq summary { font-size: 14px; line-height: 20px; }
  .home-page .home-faq details { padding: 16px 20px; }
  .home-page .cookie-inner, .home-page .cookie-actions { flex-direction: column; align-items: stretch; }
  .home-page .cookie-text { min-width: 0; }
}
@media (max-width: 480px) { .home-page #heroTitle { font-size: 42px !important; } }
@media (prefers-reduced-motion: reduce) {
  .home-page *, .home-page *::before, .home-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* Existing modal and consent contracts. */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,10,15,.85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-4);
  opacity: 0; pointer-events: none;
  transition: opacity 300ms cubic-bezier(.25,.46,.45,.94);
}
.modal-overlay.active, .modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  transform: translateY(24px) scale(.96);
  transition: transform 350ms cubic-bezier(.34,1.56,.64,1), opacity 300ms cubic-bezier(.25,.46,.45,.94);
  opacity: 0;
  position: relative;
}
.modal-overlay.active .modal, .modal-overlay.visible .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal-close {
  min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center;
  position: absolute; top: var(--space-4); right: var(--space-4);
  color: var(--color-text-muted); padding: var(--space-1);
  border-radius: var(--radius-md); transition: color var(--transition);
}
.modal-close:hover { color: var(--color-text); }
.modal-logo { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); text-align: center; }
.modal-logo-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-xl); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow); overflow: hidden;
}
.modal-logo-icon img { width: 56px; height: 56px; object-fit: cover; }
.modal-title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; }
.modal-sub { font-size: var(--text-sm); color: var(--color-text-muted); }
.modal-divider {
  display: flex; align-items: center; gap: var(--space-3);
  margin: var(--space-5) 0; color: var(--color-text-faint); font-size: var(--text-xs);
}
.modal-divider::before, .modal-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-divider); }
.login-buttons { display: flex; flex-direction: column; gap: var(--space-3); }
.login-buttons .btn { width: 100%; justify-content: center; }
.modal-note { margin-top: var(--space-5); font-size: var(--text-xs); color: var(--color-text-faint); text-align: center; line-height: 1.6; }
.modal-note a { color: var(--color-primary); text-decoration: underline; text-underline-offset: 2px; }


.modal-tos-wrap {
  margin: .75rem 0 .25rem;
  padding: .75rem 1rem;
  background: var(--color-surface-2, #141428);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color .2s;
}
.modal-tos-wrap.tos-error {
  border-color: var(--color-error);
  animation: shake .3s ease;
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25%      { transform: translateX(-6px); }
  75%      { transform: translateX(6px); }
}
.modal-tos-label {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  cursor: pointer;
  font-size: .84rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}
.modal-tos-checkbox {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.modal-tos-label a {
  color: var(--color-primary);
  text-decoration: underline;
}
.modal-tos-error {
  display: none;
  font-size: .76rem;
  color: var(--color-error);
  margin-top: .4rem;
}
.modal-tos-wrap.tos-error .modal-tos-error { display: block; }
/* Rimuovi errore quando l'utente spunta */
.modal-tos-checkbox:checked ~ * .modal-tos-error,
.modal-tos-wrap:has(.modal-tos-checkbox:checked) { border-color: var(--color-border); }
