/* ─────────────────────────────────────────────────────────────────────────────
   inner.css — Pagine interne LightAI
   Richiede: tokens.css · base.css (caricati da header.php)
───────────────────────────────────────────────────────────────────────────── */

/* ─── Scroll reveal ──────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.in         { opacity: 1; transform: none; }
.reveal-delay-1    { transition-delay: 0.10s; }
.reveal-delay-2    { transition-delay: 0.20s; }
.reveal-delay-3    { transition-delay: 0.30s; }
.reveal-delay-4    { transition-delay: 0.40s; }

/* ─── Page header / hero ─────────────────────────────────────────────────── */
.page-header,
.page-hero {
  padding-block: 80px 64px;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 72px 72px;
}
.page-header h1,
.page-hero h1 { margin-block: 12px 20px; }

.page-header > .container > p,
.page-hero > .container > p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 560px;
}

/* ─── Label / etichette mono ─────────────────────────────────────────────── */
.label,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section    { padding-block: 96px; }
.section-sm { padding-block: 64px; }
.divider    { height: 1px; background: var(--line); border: none; margin: 0; }

/* ─── Layout helpers ─────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.mb-48       { margin-bottom: 48px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px;
}

/* ─── Button variants supplementari (non in base.css) ───────────────────── */
.btn-outline {
  height: 44px;
  padding: 0 20px;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
}
.btn-outline:hover {
  opacity: 1;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.btn-white {
  height: 56px;
  padding: 0 28px;
  background: var(--bg);
  color: var(--ink);
  border: none;
  border-radius: var(--r-pill);
  font-size: 17px;
  font-weight: 600;
}

.btn-sm {
  height: 36px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
}

/* ─── CTA block giallo (come home) ──────────────────────────────────────── */
.cta-block {
  padding: 64px;
  border-radius: var(--r-card-lg);
  background: var(--highlight);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 48px;
}
.cta-block h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 44px);
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 600px;
}

/* ─── CTA block scuro ────────────────────────────────────────────────────── */
.cta-dark {
  padding: 64px;
  border-radius: var(--r-card-lg);
  background: var(--ink);
  color: var(--dark-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}
.cta-dark h2 {
  margin: 0;
  color: var(--dark-text);
  font-size: clamp(26px, 3vw, 44px);
  letter-spacing: -0.03em;
}
.cta-dark p {
  color: var(--dark-muted);
  max-width: 420px;
  margin: 0;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */
.form-group         { margin-bottom: 24px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-chip);
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  transition: border-color var(--t);
  -webkit-appearance: none;
  appearance: none;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--soft); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: #D93025;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230F0F10' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.form-error {
  display: none;
  font-size: 13px;
  color: #D93025;
  margin-top: 6px;
}
.form-error.show { display: block; }

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.form-check label {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  cursor: pointer;
}
.form-check label a { color: var(--accent); }

/* ─── Toast popup ────────────────────────────────────────────────────────── */
.lai-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9000;
  max-width: 400px;
  min-width: 260px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 8px 40px rgba(15,15,16,0.18);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  transform: translateY(16px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.lai-toast--visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.lai-toast--success { border-left: 3px solid var(--accent); }
.lai-toast--error   { border-left: 3px solid #D93025; }

.lai-toast__body { flex: 1; }

.lai-toast__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--soft);
  font-size: 18px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color var(--t);
}
.lai-toast__close:hover { color: var(--ink); }

/* ─── Blog grid ──────────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t-md);
}
.blog-card:hover { box-shadow: 0 8px 40px rgba(15,15,16,0.10); }

.blog-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--grid);
  position: relative;
  flex-shrink: 0;
}
.blog-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.blog-card:hover .blog-card__thumb img { transform: scale(1.04); }

.blog-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  padding: 4px 10px;
  background: rgba(246,245,241,0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: var(--r-pill);
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
}

.blog-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 10px;
}

.blog-body h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 10px;
}
.blog-body h3 a        { color: var(--ink); transition: color var(--t); }
.blog-body h3 a:hover  { color: var(--accent); opacity: 1; }

.blog-body > p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 18px;
  max-width: none;
}

.blog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  gap: 8px;
}
.blog-author {
  font-size: 13px;
  color: var(--soft);
  font-weight: 500;
}
.blog-read {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.blog-read:hover { opacity: 0.8; color: var(--accent); }

/* Filtro categorie */
.blog-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-block: 40px 0;
}
.blog-filter-btn {
  height: 36px;
  padding: 0 16px;
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all var(--t);
}
.blog-filter-btn:hover { border-color: var(--ink); color: var(--ink); opacity: 1; }
.blog-filter-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* Paginazione */
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 60px;
}
.blog-page-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-chip);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--t);
}
.blog-page-btn:hover { border-color: var(--ink); color: var(--ink); opacity: 1; }
.blog-page-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

/* ─── Project cards ──────────────────────────────────────────────────────── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--t-md);
}
.project-card:hover { box-shadow: 0 8px 40px rgba(15,15,16,0.10); }

.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--grid);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.project-thumb__initials {
  font-family: var(--font);
  font-size: 3rem;
  font-weight: 700;
  color: var(--line);
  letter-spacing: -0.05em;
  user-select: none;
}

.project-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.project-body h3 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.project-body p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  max-width: none;
}
.project-body__footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ─── Servizi: componenti ────────────────────────────────────────────────── */
.srv-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: start;
}

.srv-visual {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px;
}

.srv-mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.srv-delivery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.srv-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.srv-feature-icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  background: rgba(35, 64, 240, 0.08);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  flex-shrink: 0;
}
.srv-feature-title  { font-weight: 600; font-size: 15px; margin-bottom: 4px; color: var(--ink); }
.srv-feature-desc   { font-size: 14px; color: var(--muted); margin: 0; max-width: none; }

.srv-tag {
  display: inline-block;
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.srv-step {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.srv-step:last-child { border-bottom: none; }
.srv-step-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}
.srv-step-desc { font-size: 13px; color: var(--muted); max-width: none; }

/* Stat boxes nei visual servizi */
.stat-box {
  background: var(--bg);
  border-radius: var(--r-chip);
  padding: 16px;
}
.stat-box__val {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.stat-box__val--accent { color: var(--accent); }
.stat-box__label { font-size: 13px; color: var(--muted); margin-top: 4px; max-width: none; }

/* Demo chat agente */
.chat-row     { display: flex; gap: 9px; margin-bottom: 12px; }
.chat-row.usr { flex-direction: row-reverse; }
.chat-av {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.chat-bub {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  max-width: none;
}
.chat-bub.ai {
  background: rgba(35, 64, 240, 0.06);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 3px;
  max-width: 80%;
}
.chat-bub.usr {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
  max-width: 80%;
}

/* ─── Chi siamo: componenti ──────────────────────────────────────────────── */
.cs-manifesto {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.cs-team {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.cs-team-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
}
.cs-team-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
  flex-shrink: 0;
  border: 3px solid var(--line);
}
.cs-team-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cs-team-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.cs-team-role {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 14px;
  color: var(--accent);
}
.cs-team-bio {
  font-size: 14px;
  line-height: 1.72;
  color: var(--muted);
  flex: 1;
  margin: 0 0 18px;
  max-width: none;
}
.cs-team-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.cs-team-link:hover { color: var(--accent); opacity: 0.8; }

.cs-valori { display: flex; flex-direction: column; gap: 12px; }
.cs-valore {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px;
}
.cs-valore-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
  padding-top: 3px;
  min-width: 20px;
  font-weight: 500;
}
.cs-valore-title { font-weight: 600; font-size: 15px; color: var(--ink); margin-bottom: 5px; }
.cs-valore-desc  { font-size: 14px; color: var(--muted); margin: 0; max-width: none; }

.cs-processo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.cs-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px 18px;
}
.cs-step-num {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--r-chip);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  background: rgba(35, 64, 240, 0.08);
  color: var(--accent);
  flex-shrink: 0;
}
.cs-step h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.cs-step p { font-size: 14px; margin: 0; color: var(--muted); max-width: none; }

/* Sezione con sfondo surface */
.section--surface {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ─── Contatti: layout ───────────────────────────────────────────────────── */
.contatti-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 64px;
  align-items: start;
}
.contatti-sidebar { display: flex; flex-direction: column; gap: 16px; }
.contatti-info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px 24px;
}
.contatti-info-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.contatti-info-value {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
  display: block;
}
.contatti-info-sub {
  font-size: 14px;
  color: var(--muted);
  max-width: none;
}

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.empty-state p a { color: var(--accent); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (min-width: 860px) {
  .srv-layout { grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
  .cs-manifesto { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
}
@media (min-width: 580px) { .cs-team { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cs-team { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 480px) { .srv-mini-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 600px) { .cs-processo { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .srv-visual { padding: 36px; } }

@media (max-width: 960px) {
  .contatti-grid { grid-template-columns: 1fr; gap: 40px; }
  .cta-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    padding: 48px;
  }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  .page-header, .page-hero { padding-block: 56px 40px; }
  .section    { padding-block: 64px; }
  .section-sm { padding-block: 40px; }
  .card       { padding: 20px; }
  .grid-2     { grid-template-columns: 1fr; }

  .cta-block  { padding: 28px 24px; gap: 24px; }
  .cta-block .btn-dark,
  .cta-block .btn-dark-lg,
  .cta-block .btn-primary { width: 100%; justify-content: center; }

  .cta-dark { padding: 40px 24px; }
  .cta-dark .btn-white { width: 100%; justify-content: center; }

  .blog-grid { grid-template-columns: 1fr; }

  .lai-toast {
    left: 16px;
    right: 16px;
    bottom: 24px;
    max-width: none;
    min-width: 0;
  }
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .lai-toast { transition: none !important; }
}
