/* ==========================================================================
   THE WISE GUY · Contatti 1c-bis ("Banco di Regia · Studio Firenze")
   Sistema di pagina PAGINA-STANDARD + WCAG AAA/AA accessibilita + parity scuro/chiaro
   ========================================================================== */

@property --ct-spot-x {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}
@property --ct-spot-y {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 50%;
}
@property --ct-spot-size {
  syntax: "<length-percentage>";
  inherits: true;
  initial-value: 0px;
}

.ct-main {
  padding-bottom: 56px;
}

/* Visually hidden live region */
.ct-sr-only {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* ── Hero right Banco Status Panel ── */
.ct-hero-panel {
  border-radius: 18px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card-solid);
  padding: 20px 22px;
  display: grid;
  gap: 14px;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.28);
}
:root[data-theme="light"] .ct-hero-panel {
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}
.ct-hp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ct-hp-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-emerald);
}
:root[data-theme="light"] .ct-hp-status {
  color: #047857;
}
.ct-hp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}
.ct-hp-loc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.ct-hp-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--fg-primary);
}
.ct-hp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ct-hp-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background-color 0.18s ease;
}
.ct-hp-pill:hover,
.ct-hp-pill[aria-pressed="true"] {
  border-color: var(--accent-cyan);
  color: var(--fg-primary);
  background: color-mix(in srgb, var(--accent-cyan) 12%, transparent);
}
.ct-hp-pill:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
.ct-hp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--fg-secondary);
}
.ct-hp-jam {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
}
:root[data-theme="light"] .ct-hp-jam {
  color: #0e7490;
}

/* ── Banco di Regia: Canali grid + Interactive Spotlight ── */
.ct-deck {
  position: relative;
  border-radius: 22px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card-solid);
  padding: 24px;
  overflow: hidden;
}
.ct-deck-spot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--ct-spot-x, 50%) var(--ct-spot-y, 50%),
    color-mix(in srgb, var(--accent-cyan) 14%, transparent) 0%,
    transparent 65%
  );
  -webkit-mask-image: radial-gradient(
    circle at var(--ct-spot-x, 50%) var(--ct-spot-y, 50%),
    #000 0,
    transparent var(--ct-spot-size, 0px)
  );
  mask-image: radial-gradient(
    circle at var(--ct-spot-x, 50%) var(--ct-spot-y, 50%),
    #000 0,
    transparent var(--ct-spot-size, 0px)
  );
  transition: --ct-spot-size 0.25s ease;
}
.ct-deck:hover {
  --ct-spot-size: 420px;
}
.ct-deck-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.ct-deck-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-secondary);
}
.ct-ch-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.ct-ch-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-subtle) 65%, var(--bg-card-solid));
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ct-ch-card:hover,
.ct-ch-card.is-selected {
  border-color: var(--ct-ch-accent, var(--accent-cyan));
  transform: translateY(-2px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--ct-ch-accent, var(--accent-cyan)) 15%, transparent);
}
.ct-ch-card--wa { --ct-ch-accent: #22c55e; }
.ct-ch-card--alfred { --ct-ch-accent: #34d399; }
.ct-ch-card--email { --ct-ch-accent: #a855f7; }
.ct-ch-card--linkedin { --ct-ch-accent: #38bdf8; }
.ct-ch-card--x { --ct-ch-accent: #f8fafc; }
:root[data-theme="light"] .ct-ch-card--x { --ct-ch-accent: #0f172a; }
.ct-ch-card--jam { --ct-ch-accent: #22d3ee; }

.ct-ch-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
}
.ct-ch-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.ct-ch-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--ct-ch-accent, var(--accent-cyan)) 35%, transparent);
  background: color-mix(in srgb, var(--ct-ch-accent, var(--accent-cyan)) 14%, transparent);
  color: var(--ct-ch-accent, var(--accent-cyan));
}
.ct-ch-ico svg {
  width: 22px;
  height: 22px;
}
.ct-ch-ico--alfred img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}
.ct-ch-name {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 750;
  color: var(--fg-primary);
}
.ct-ch-handle {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-muted);
}
.ct-ch-sla {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-solid);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 650;
  color: var(--fg-secondary);
  white-space: nowrap;
}
.ct-ch-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-secondary);
}
.ct-wa-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ct-wa-chip {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-solid);
  color: var(--fg-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ct-wa-chip[aria-pressed="true"],
.ct-wa-chip:hover {
  border-color: #22c55e;
  color: var(--fg-primary);
  background: rgba(34, 197, 94, 0.14);
}
.ct-wa-preview {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed var(--border-medium);
  background: var(--bg-card-solid);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  color: var(--fg-secondary);
}
.ct-ch-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
}
.ct-ch-foot .btn {
  min-height: 44px;
}

/* ── Modulo + Studio Console Layout ── */
.ct-work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.88fr);
  gap: 24px;
  align-items: start;
}
.ct-form-card,
.ct-console-card {
  border-radius: 20px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card-solid);
  padding: 26px;
}
.ct-console-col {
  display: grid;
  gap: 18px;
}
.ct-form-title {
  margin: 0 0 6px;
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 750;
  color: var(--fg-primary);
}
.ct-form-sub {
  margin: 0 0 20px;
  font-size: 14.5px;
  color: var(--fg-secondary);
}
.ct-field-hint {
  display: block;
  font-size: 12px;
  color: var(--fg-muted);
  margin: -2px 0 4px;
}
.ct-field-err {
  display: none;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: #f87171;
}
:root[data-theme="light"] .ct-field-err {
  color: #b91c1c;
}
.ct-form-card .field-input {
  font-family: inherit;
  font-size: max(1rem, 1em);
  min-height: 48px;
  border-width: 1.5px;
}
.ct-form-card textarea.field-input {
  min-height: 112px;
  resize: vertical;
}
.ct-form-card .field-input:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
.ct-form-card :is(input, textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.08);
}
.ct-form-card :is(input, textarea):is(:user-invalid, .user-invalid-fallback) + .ct-field-err {
  display: block;
}
.ct-privacy-note {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--fg-muted);
  text-align: center;
}
.ct-privacy-note a {
  color: var(--fg-secondary);
  text-decoration: underline;
}

@media (pointer: coarse) {
  .ct-form-card .field-input {
    min-height: 52px;
  }
  .ct-ch-foot .btn,
  .ct-hp-pill,
  .ct-copy-btn {
    min-height: 48px;
  }
}

/* ── Success animated confirmation card ── */
.ct-success-box {
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--accent-emerald);
  background: var(--accent-emerald-soft);
}
.ct-success-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ct-success-check {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-emerald);
  color: #03150e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ct-success-check path {
  stroke-dasharray: 36;
  stroke-dashoffset: 0;
  animation: ct-check-draw 0.55s ease-out both;
}
@keyframes ct-check-draw {
  from { stroke-dashoffset: 36; }
  to { stroke-dashoffset: 0; }
}

/* ── Live Local Analyzer Card ── */
.ct-radar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.ct-radar-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--accent-emerald);
}
:root[data-theme="light"] .ct-radar-badge {
  color: #047857;
}
.ct-topic-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.ct-topic-chip {
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  color: var(--fg-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.ct-topic-chip:hover,
.ct-topic-chip[aria-pressed="true"] {
  border-color: var(--accent-violet);
  color: var(--fg-primary);
  background: color-mix(in srgb, var(--accent-violet) 16%, transparent);
}
.ct-radar-out {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  display: grid;
  gap: 10px;
}
.ct-radar-mods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ct-radar-mod-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-card-solid);
  color: var(--fg-primary);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.ct-radar-mod-link:hover {
  border-color: var(--accent-cyan);
}

/* ── Wise Jam "Ascolta mentre scrivi" Switch Card ── */
.ct-jam-card {
  border-color: color-mix(in srgb, var(--accent-cyan) 36%, var(--border-medium));
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent-cyan) 9%, var(--bg-card-solid)), var(--bg-card-solid) 65%);
}
.ct-jam-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ct-jam-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-medium);
  background: var(--bg-subtle);
  color: var(--fg-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.ct-jam-switch:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}
.ct-jam-knob {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  position: relative;
  transition: background-color 0.2s ease;
}
.ct-jam-knob::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}
.ct-jam-switch[aria-checked="true"] {
  border-color: #22d3ee;
  background: rgba(34, 211, 238, 0.14);
}
.ct-jam-switch[aria-checked="true"] .ct-jam-knob {
  background: #22d3ee;
}
.ct-jam-switch[aria-checked="true"] .ct-jam-knob::after {
  transform: translateX(16px);
}
.ct-jam-now {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ct-jam-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}
.ct-jam-bars i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent-cyan);
  opacity: 0.45;
}
.ct-jam-card.is-playing .ct-jam-bars i {
  opacity: 1;
  animation: ct-bar-eq 0.9s ease-in-out infinite alternate;
}
.ct-jam-card.is-playing .ct-jam-bars i:nth-child(2) { animation-delay: 0.18s; }
.ct-jam-card.is-playing .ct-jam-bars i:nth-child(3) { animation-delay: 0.36s; }
.ct-jam-card.is-playing .ct-jam-bars i:nth-child(4) { animation-delay: 0.12s; }
@keyframes ct-bar-eq {
  0% { height: 5px; }
  100% { height: 18px; }
}
.ct-jam-vol {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--fg-secondary);
}
.ct-jam-vol input[type="range"] {
  width: 110px;
  accent-color: #22d3ee;
}
.ct-jam-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg-secondary);
}

/* ── Come si svolgono i 30 minuti (una sola volta, statica) ── */
.ct-step-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
}
:root[data-theme="light"] .ct-step-num {
  color: #0e7490;
}
.ct-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .ct-deck-spot,
  .ct-ch-card,
  .ct-jam-knob,
  .ct-jam-knob::after,
  .ct-success-check path,
  .ct-jam-card.is-playing .ct-jam-bars i {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1080px) {
  .ct-ch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .ct-work-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ct-ch-grid {
    grid-template-columns: 1fr;
  }
  .ct-deck,
  .ct-form-card,
  .ct-console-card {
    padding: 18px 16px;
  }
}
