/* ════════════════════════════════════════════════════════════
   EvolviDigital — Assessment Studi Commercialisti
   Brand: navy / blue / cyan · Outfit + DM Sans + JetBrains Mono
════════════════════════════════════════════════════════════ */

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

:root {
  --blue:        #1052e8;
  --blue-bright: #3a7aff;
  --blue-deep:   #0038c4;
  --cyan:        #00b8d9;
  --cyan-bright: #00d4f5;

  --navy:        #091627;
  --navy-mid:    #0f2035;
  --navy-light:  #162c45;
  --border:      rgba(16,82,232,0.18);
  --border-cyan: rgba(0,184,217,0.28);

  --white:       #ffffff;
  --text:        #c8d6e8;
  --muted:       #4e6a88;
  --red:         #ff4d6d;
  --yellow:      #ffd166;

  --radius:      16px;
  --maxw:        1080px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(0,184,217,0.3); color: #fff; }

/* ─── shared atmosphere (grid + glows) ─── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(16,82,232,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16,82,232,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 100%);
}

h1, h2, h3, .font-display { font-family: 'Outfit', sans-serif; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ════════════════ NAVBAR ════════════════ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 56px);
  background: rgba(9,22,39,0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-logo { display: flex; align-items: center; gap: 14px; }
.nav-logo .mark { width: 40px; height: 40px; flex-shrink: 0; }
.nav-wordmark {
  font-family: 'Outfit', sans-serif; font-weight: 800;
  font-size: 20px; letter-spacing: -0.03em; line-height: 1;
}
.nav-wordmark .evolvi { color: #fff; }
.nav-wordmark .digital {
  background: linear-gradient(90deg, #1052e8, #3a7aff, #00b8d9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-tag { font-size: 11px; color: var(--cyan); letter-spacing: 0.06em; margin-top: 2px; }
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
  color: var(--blue-bright); text-decoration: none;
  background: rgba(16,82,232,0.1); border: 1px solid rgba(16,82,232,0.3);
  transition: all 0.2s;
}
.nav-cta:hover { background: rgba(16,82,232,0.2); }

/* ════════════════ HERO ════════════════ */
.hero {
  position: relative; z-index: 1;
  min-height: calc(100vh - 73px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px clamp(20px, 5vw, 56px) 100px;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 50% -5%, rgba(16,82,232,0.28) 0%, transparent 65%),
    radial-gradient(ellipse 45% 45% at 88% 95%, rgba(0,184,217,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 35% 35% at 8% 80%, rgba(16,82,232,0.14) 0%, transparent 60%);
}
.hero-mark { width: 132px; height: 132px; margin-bottom: 32px; filter: drop-shadow(0 0 28px rgba(16,82,232,0.45)); }
.hero-badge {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(0,184,217,0.08); border: 1px solid var(--border-cyan);
  border-radius: 100px; padding: 7px 18px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 32px;
}
.hero-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.5); } }

.hero h1 {
  font-size: clamp(38px, 6.4vw, 68px);
  font-weight: 800; line-height: 1.05; letter-spacing: -0.035em;
  color: var(--white); max-width: 16ch; margin-bottom: 24px;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #3a7aff 10%, #00b8d9 90%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
  font-size: clamp(16px, 2vw, 20px); color: var(--text); max-width: 60ch;
  margin-bottom: 44px; line-height: 1.6;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 16px;
  border: none; cursor: pointer; text-decoration: none;
  padding: 15px 30px; border-radius: 12px; transition: all 0.2s; letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, #1052e8, #0038c4);
  color: #fff; box-shadow: 0 6px 28px rgba(16,82,232,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 38px rgba(16,82,232,0.55); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); padding: 15px 26px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); border-color: var(--border-cyan); color: #fff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: center;
  margin-top: 52px; font-size: 13px; color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }

/* ════════════════ "COME FUNZIONA" STRIP ════════════════ */
.how {
  position: relative; z-index: 1;
  max-width: var(--maxw); margin: 0 auto; padding: 24px clamp(20px, 5vw, 40px) 40px;
}
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how-card {
  background: var(--navy-mid); border: 1px solid var(--border); border-radius: 14px; padding: 24px;
}
.how-card .num {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600;
  color: var(--cyan); background: rgba(0,184,217,0.08);
  border: 1px solid var(--border-cyan); padding: 4px 10px; border-radius: 6px;
  display: inline-block; margin-bottom: 14px;
}
.how-card h3 { font-size: 17px; color: var(--white); font-weight: 700; margin-bottom: 6px; }
.how-card p { font-size: 14px; color: var(--muted); }

/* ════════════════ FORM / SECTIONS ════════════════ */
.assessment { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 40px clamp(20px, 5vw, 40px) 120px; }

.section {
  background: var(--navy-mid); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); margin-bottom: 22px;
  scroll-margin-top: 90px;
}
.section-head { margin-bottom: 28px; }
.eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; color: var(--white); letter-spacing: -0.02em; line-height: 1.15; }
.section-head p { font-size: 15px; color: var(--muted); margin-top: 8px; max-width: 70ch; }

/* fields */
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.q-stack { display: flex; flex-direction: column; gap: 18px; }

label.field { display: flex; flex-direction: column; gap: 8px; }
.field > span, .lbl {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4;
}
.field .hint { font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: -2px; }

input, textarea, select {
  width: 100%;
  font-family: 'DM Sans', sans-serif; font-size: 15px; color: var(--white);
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 15px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus {
  border-color: var(--border-cyan); box-shadow: 0 0 0 3px rgba(0,184,217,0.1);
}
select { cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%234e6a88' d='M6 8L1 3h10z'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
input[type="date"] { color-scheme: dark; }

/* maturity slider */
.score-row {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border);
}
.score-row .lbl { flex-shrink: 0; }
.score-row input[type="range"] {
  flex: 1; min-width: 180px; height: 6px; padding: 0; background: transparent; border: none;
  -webkit-appearance: none; appearance: none; cursor: pointer;
}
.score-row input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 6px; background: linear-gradient(90deg, #1052e8, #00b8d9);
}
.score-row input[type="range"]::-moz-range-track {
  height: 6px; border-radius: 6px; background: linear-gradient(90deg, #1052e8, #00b8d9);
}
.score-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%;
  background: #fff; border: 3px solid var(--blue); box-shadow: 0 2px 10px rgba(0,0,0,0.4); cursor: pointer;
}
.score-row input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); cursor: pointer;
}
.score-row output {
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 22px; color: var(--cyan);
  width: 30px; text-align: center; flex-shrink: 0;
}

/* tools row */
.tools {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 20px;
}
.tools label.field { flex: 0 0 220px; }
.btn-sm {
  padding: 10px 18px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
  background: rgba(0,184,217,0.1); color: var(--cyan); border: 1px solid var(--border-cyan);
  font-family: 'DM Sans', sans-serif; transition: all 0.2s;
}
.btn-sm:hover { background: rgba(0,184,217,0.18); }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
thead th {
  text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  padding: 12px 12px; background: var(--navy-light); border-bottom: 1px solid var(--border);
}
tbody td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody input, tbody select { padding: 9px 11px; font-size: 14px; }
td[data-cost], .cost { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--cyan); white-space: nowrap; }
.remove-row {
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; line-height: 1;
  background: rgba(255,77,109,0.1); color: var(--red); border: 1px solid rgba(255,77,109,0.25);
  font-size: 15px; transition: all 0.2s;
}
.remove-row:hover { background: rgba(255,77,109,0.2); }

/* opportunity cards */
.opp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 8px; }
.opp-card {
  background: var(--navy-light); border: 1px solid var(--border); border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px; position: relative;
}
.opp-card .opp-row { display: flex; gap: 12px; }
.opp-card .opp-row label.field { flex: 1; }
.opp-priority {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; flex-direction: column; align-items: center; font-family: 'Outfit', sans-serif;
}
.opp-priority strong { font-size: 24px; font-weight: 800; color: var(--cyan); line-height: 1; }
.opp-priority span { font-size: 9px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 2px; }
.opp-card .remove-row { align-self: flex-end; width: auto; height: auto; padding: 7px 14px; font-size: 12px; font-weight: 600; }

/* summary */
.summary-top { display: grid; grid-template-columns: 240px 1fr; gap: 18px; margin-bottom: 22px; }
.score-card {
  background: linear-gradient(150deg, rgba(16,82,232,0.16), rgba(0,184,217,0.08));
  border: 1px solid var(--border-cyan); border-radius: 14px; padding: 24px;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.score-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--cyan); font-weight: 600; }
.score-card strong { font-family: 'Outfit', sans-serif; font-size: 56px; font-weight: 800; color: var(--white); line-height: 1; margin: 8px 0 6px; }
.score-card p { font-size: 13px; color: var(--text); }

/* ════════════════ SUBMIT ════════════════ */
.submit-zone {
  background: linear-gradient(150deg, rgba(16,82,232,0.12), rgba(0,184,217,0.06));
  border: 1px solid var(--border-cyan); text-align: center;
}
.submit-zone h2 { margin-bottom: 8px; }
.submit-zone p { margin: 0 auto 28px; max-width: 56ch; }
.submit-zone .btn-primary { font-size: 17px; padding: 17px 44px; }
.status {
  margin-top: 22px; font-size: 14.5px; min-height: 22px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 9px;
}
.status.ok { color: var(--cyan); }
.status.err { color: var(--red); }
.status.busy { color: var(--text); }
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.25);
  border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.submit-hint { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ════════════════ FOOTER ════════════════ */
.footer {
  position: relative; z-index: 1; border-top: 1px solid var(--border);
  padding: 34px clamp(20px, 5vw, 56px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  font-size: 13px; color: var(--muted);
}
.footer-logo { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 18px; }
.footer-logo .evolvi { color: var(--white); }
.footer-logo .digital {
  background: linear-gradient(90deg, #1052e8, #00b8d9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ════════════════ LOGOMARK ANIMATION ════════════════ */
.mark-svg path { fill: none; stroke-width: 3; transform-origin: 50% 50%; }
.mark-svg path:nth-of-type(1) { stroke: #1052e8; opacity: 1;    animation: spin-cw  5s linear infinite; }
.mark-svg path:nth-of-type(2) { stroke: #00b8d9; opacity: 0.65; animation: spin-ccw 4s linear infinite 0.3s; }
.mark-svg path:nth-of-type(3) { stroke: #3a7aff; opacity: 0.28; animation: spin-cw  10s linear infinite reverse 0.6s; }
@keyframes spin-cw  { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes spin-ccw { from { transform: rotate(0); } to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) {
  .mark-svg path { animation: none !important; }
  .mark-svg path:nth-of-type(2) { transform: rotate(42deg); }
  .mark-svg path:nth-of-type(3) { transform: rotate(-28deg); }
}

/* ════════════════ RESPONSIVE ════════════════ */
@media (max-width: 760px) {
  .how-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .opp-grid { grid-template-columns: 1fr; }
  .summary-top { grid-template-columns: 1fr; }
  .nav-tag { display: none; }
  .tools label.field { flex: 1 1 100%; }
}

/* print */
@media print {
  .nav, .hero, .how, .submit-zone .btn-primary, .footer, .bg-grid { display: none !important; }
  body { background: #fff; color: #111; }
  .section { border: 1px solid #ccc; background: #fff; break-inside: avoid; }
  .section-head h2, .field > span, .lbl { color: #111; }
}
