/* CCNL.ai — Apple-inspired design system */

:root {
  /* Palette */
  --bg: #ffffff;
  --bg-elev: #f5f5f7;
  --bg-section: #fbfbfd;
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --text-subtle: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --success: #34c759;
  --warning: #ff9500;
  --danger: #ff3b30;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.18);

  /* Typography */
  --font-display: -apple-system, "SF Pro Display", BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  --font-text: -apple-system, "SF Pro Text", BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Consolas, monospace;

  /* Sizing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 980px;

  /* Shadow */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --t-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --t-med: 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elev: #1c1c1e;
    --bg-section: #0a0a0a;
    --text: #f5f5f7;
    --text-muted: #a1a1a6;
    --text-subtle: #8e8e93;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --accent: #2997ff;
    --accent-hover: #4ba8ff;
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--text);
  line-height: 1.47059;
  letter-spacing: -0.022em;
  font-weight: 400;
  font-size: 17px;
}

/* ----------------------------- Layout ------------------------------ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 96px 0;
}

@media (min-width: 1024px) {
  section {
    padding: 128px 0;
  }
}

/* ----------------------------- Nav --------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  height: 48px;
  display: flex;
  align-items: center;
}

@media (prefers-color-scheme: dark) {
  .nav { background: rgba(0, 0, 0, 0.72); }
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.nav-brand .dot { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
  list-style: none;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: opacity var(--t-fast);
}

.nav-links a:hover { opacity: 0.7; }

.nav-cta {
  background: var(--accent);
  color: white !important;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-weight: 500;
}

/* ----------------------------- Typography -------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--text);
}

h1 {
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 700;
}

h2 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 600;
}

h3 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h4 {
  font-size: 21px;
  line-height: 1.25;
}

.lead {
  font-size: clamp(20px, 2.5vw, 28px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 760px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.muted { color: var(--text-muted); }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ----------------------------- Buttons ----------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  font-size: 17px;
  font-weight: 400;
  font-family: var(--font-text);
  letter-spacing: -0.01em;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: scale(1.02);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid currentColor;
}

.btn-secondary:hover {
  background: rgba(0, 113, 227, 0.06);
}

.btn-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap var(--t-fast);
}

.btn-link:hover { gap: 8px; }
.btn-link::after { content: "›"; font-weight: 600; }

/* ----------------------------- Hero -------------------------------- */

.hero {
  text-align: center;
  padding: 96px 0 64px;
  background: radial-gradient(ellipse at top, rgba(0, 113, 227, 0.06), transparent 60%);
}

.hero h1 {
  margin-bottom: 24px;
  background: linear-gradient(180deg, var(--text) 0%, var(--text-muted) 140%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lead {
  margin: 0 auto 40px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----------------------------- Cards ------------------------------- */

.card {
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  padding: 40px;
  transition: transform var(--t-med), box-shadow var(--t-med);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
}

/* ----------------------------- Feature ----------------------------- */

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(0, 113, 227, 0.12);
  color: var(--accent);
  margin-bottom: 24px;
}

.feature h3 { margin-bottom: 12px; }
.feature p { color: var(--text-muted); font-size: 17px; }

/* ----------------------------- Pricing ----------------------------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.price-card {
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Featured card: ALWAYS dark with light text — distinct in both light & dark modes */
.price-card.featured {
  background: #1d1d1f;
  color: #f5f5f7;
}

.price-card.featured h3,
.price-card.featured .price-amount {
  color: #f5f5f7 !important;
}

.price-card.featured .price-period,
.price-card.featured .price-feature {
  color: rgba(245, 245, 247, 0.78);
}

.price-card.featured > p {
  color: rgba(245, 245, 247, 0.7) !important;
}

.price-card.featured .price-feature::before {
  color: #2997ff;
}

.price-badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.price-amount {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 16px 0 4px;
  font-variant-numeric: tabular-nums;
}

.price-amount .currency { font-size: 32px; vertical-align: top; }
.price-period { font-size: 15px; color: var(--text-muted); margin-bottom: 32px; }

.price-features {
  list-style: none;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.price-feature {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  line-height: 1.4;
}

.price-feature::before {
  content: "✓";
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

.price-card.featured .price-feature::before { color: var(--accent); }

/* ----------------------------- Section header ---------------------- */

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header h2 { margin-bottom: 16px; }
.section-header p {
  color: var(--text-muted);
  font-size: 21px;
  max-width: 640px;
  margin: 0 auto;
}

/* ----------------------------- Code block -------------------------- */

/* Code block: ALWAYS dark — syntax colors are tuned for dark background */
.code-block {
  background: #1d1d1f;
  color: #f5f5f7;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  padding: 24px 28px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  text-align: left;
  white-space: pre;            /* preserve line breaks */
  word-wrap: normal;
  margin: 0;                   /* reset for <pre> */
  border: 1px solid rgba(255,255,255,0.08);
}

.code-block .keyword { color: #ff7ab2; }
.code-block .string { color: #faf18b; }
.code-block .comment { color: #8e8e93; }
.code-block .num { color: #d0bcff; }

/* ----------------------------- Data tables ------------------------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-strong);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td { background: var(--bg-elev); }

.data-table .num-col { text-align: right; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-elev);
  color: var(--text-muted);
}

.badge-quadro { background: rgba(0, 113, 227, 0.12); color: var(--accent); }
.badge-impiegato { background: rgba(52, 199, 89, 0.14); color: #248a3d; }
.badge-operaio { background: rgba(255, 149, 0, 0.14); color: #c93400; }

/* ----------------------------- Footer ------------------------------ */

footer {
  background: var(--bg-section);
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-grid h5 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-grid a { color: var(--text-muted); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); }

.footer-legal {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  text-align: center;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ----------------------------- Hero data preview ------------------- */

.hero-preview {
  margin-top: 80px;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xl);
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--border);
}

.preview-window {
  background: var(--bg);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.preview-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
}
.preview-dot:nth-child(1) { background: #ff5f57; }
.preview-dot:nth-child(2) { background: #ffbd2e; }
.preview-dot:nth-child(3) { background: #28ca42; }

.preview-url {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.preview-body { padding: 32px; }

/* CCNL detail page */
.crumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.crumbs a { color: var(--text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.detail-header {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
}
.meta-pill strong { color: var(--text); font-weight: 500; }

.section-block {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.section-block:last-child { border-bottom: none; }

.section-block h3 {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-block .meta-line {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.locked-blur {
  position: relative;
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
}

.lock-overlay {
  position: relative;
}

.lock-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--bg) 80%);
  pointer-events: none;
}

.lock-cta {
  position: relative;
  margin-top: -40px;
  text-align: center;
  padding: 24px;
  z-index: 2;
}

.locked-section {
  background: var(--bg-elev);
  border: 1px dashed var(--border-strong);
  padding: 32px;
  border-radius: var(--radius-md);
  text-align: center;
}

.locked-section .lock-icon {
  font-size: 24px;
  margin-bottom: 8px;
}
