@import "tailwindcss";

/* ──────────────────────────────────────────────────────────
   Aedoc design system — palette "Gaia"
   Fonts: Source Serif 4 (display) + Inter (body)
   Palette: lavender-blue page + royal blue brand + warm whites
   Class names kept as `.aedoc-*` for backwards compatibility
   with existing partials and Stimulus controllers.
   ────────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --bg: #EEF2FB;
  --bg-page: #EEF2FB;
  --bg-subtle: #F5F7FB;
  --bg-hover: #F7F9FC;
  --surface: #FFFFFF;

  /* Foregrounds */
  --ink: #0B1220;
  --ink-2: #1A2233;
  --muted: #5A6478;
  --muted-soft: #9098A8;
  --on-dark: #FFFFFF;

  /* Borders */
  --border: #E2E5EE;
  --border-strong: #C9CFDB;
  --border-soft: #EEF1F6;

  /* Brand (royal blue) — alias `accent` per non rompere i partial esistenti */
  --brand: #1F4FE0;
  --brand-hover: #1A45C7;
  --brand-press: #163CB0;
  --brand-soft: #E8EEFC;
  --brand-ring: rgba(31, 79, 224, 0.15);
  --accent: #1F4FE0;
  --accent-hover: #1A45C7;
  --accent-bg: #E8EEFC;
  --accent-bg-soft: #F5F7FB;
  --accent-border: #C9CFDB;

  /* Semantic */
  --success: #16A34A;
  --success-bg: #E7F7EE;
  --success-border: #16A34A;
  --warning: #F59E0B;
  --warning-bg: #FEF3E2;
  --error: #E5484D;
  --error-bg: #FCEAEB;
  --info: #1F4FE0;
  --info-bg: #E8EEFC;

  /* Status pill colors (mapped to AASM states) */
  --pill-blue: #1F4FE0;
  --pill-blue-bg: #E8EEFC;
  --pill-green: #16A34A;
  --pill-green-bg: #E7F7EE;
  --pill-violet: #7C3AED;
  --pill-violet-bg: #EDE9FE;
  --pill-amber: #F59E0B;
  --pill-amber-bg: #FEF3E2;
  --pill-coral: #E5484D;
  --pill-coral-bg: #FCEAEB;
  --pill-slate: #5A6478;
  --pill-slate-bg: #F5F7FB;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(11, 18, 32, 0.04);
  --shadow-md: 0 4px 16px rgba(11, 18, 32, 0.06);
  --shadow-popover: 0 10px 28px rgba(11, 18, 32, 0.10);

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* Type */
  --f-display: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --f-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Courier New', monospace;
}

html, body {
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--ink-2);
}

body.aedoc { background: var(--bg); color: var(--ink-2); }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }

.aedoc-serif { font-family: var(--f-display); letter-spacing: -0.01em; }

/* ── Top bar (BO + applicant + admin) ───────────────────── */
.aedoc-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.aedoc-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
  line-height: 1;
}
.aedoc-topbar .brand img { width: 28px; height: 28px; flex-shrink: 0; }
.aedoc-topbar .brand .lt { font-weight: 400; color: var(--brand); }

.aedoc-topbar .nav { display: flex; height: 100%; gap: 22px; align-items: stretch; margin-left: 8px; }
.aedoc-topbar .nav a {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  border-bottom: 2px solid transparent;
  padding: 0 2px;
  transition: color 0.15s;
}
.aedoc-topbar .nav a:hover { color: var(--brand); }
.aedoc-topbar .nav a.active { color: var(--brand); border-bottom-color: var(--brand); }

.aedoc-topbar .right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.aedoc-topbar .user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.aedoc-topbar .user-info strong { color: var(--ink-2); font-weight: 600; }
.aedoc-topbar .logout {
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}
.aedoc-topbar .logout:hover { color: var(--brand); }

.tenant-chip {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

.aedoc-badge-superadmin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--pill-coral-bg);
  border: 1px solid var(--pill-coral);
  color: var(--pill-coral);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Save pill */
.save-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.save-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.save-pill.saving .dot { background: var(--brand); animation: aedoc-pulse 1s infinite; }
@keyframes aedoc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Icon button */
.iconbtn {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--bg-page);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  cursor: pointer;
  border: none;
  position: relative;
}
.iconbtn:hover { background: var(--brand-soft); color: var(--brand); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn .b {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand);
  border: 2px solid var(--bg-page);
}

/* Avatar */
.aedoc-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}

/* ── Page container ──────────────────────────────────────── */
.aedoc-page { max-width: 1080px; margin: 0 auto; padding: 32px 32px 120px; }
.aedoc-page-container { max-width: 1280px; margin: 0 auto; padding: 32px 32px 80px; }

/* Page header */
.aedoc-page-header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.aedoc-page-header.column { flex-direction: column; align-items: stretch; }
.aedoc-page-header h1, .aedoc-page-title {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 6px 0;
}
.aedoc-page-subtitle { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }
.aedoc-page-actions { display: flex; align-items: center; gap: 12px; }

/* Breadcrumb */
.aedoc-breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.aedoc-breadcrumb a { color: var(--muted); }
.aedoc-breadcrumb a:hover { color: var(--ink-2); }
.aedoc-breadcrumb .sep { margin: 0 8px; color: var(--muted-soft); }
.aedoc-breadcrumb .here { color: var(--ink-2); font-weight: 500; }

/* Hero band (form pages) */
.aedoc-hero { background: var(--bg-page); padding: 32px 0 0; border-bottom: 1px solid var(--border); }
.aedoc-hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.aedoc-hero-head h1 {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
}
.aedoc-hero-meta {
  display: flex; gap: 18px; align-items: center;
  margin-top: 6px;
  font-size: 13px; color: var(--muted);
}
.aedoc-hero-meta b { color: var(--ink-2); font-weight: 500; }
.aedoc-hero-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-soft); }

.aedoc-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Stepper (a barre orizzontali, 8-col grid) ──────────── */
.aedoc-stepper {
  display: grid;
  grid-template-columns: repeat(var(--steps, 8), 1fr);
  gap: 10px;
  margin: 28px 0 0;
  padding-bottom: 28px;
}
.aedoc-step { display: flex; flex-direction: column; gap: 8px; min-width: 0; cursor: pointer; }
.aedoc-step .bar { height: 4px; border-radius: 2px; background: var(--border); transition: background 0.2s; }
.aedoc-step.done .bar, .aedoc-step.active .bar { background: var(--brand); }
.aedoc-step .meta { display: flex; align-items: center; gap: 7px; min-width: 0; }
.aedoc-step .num {
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border);
  color: var(--muted);
  flex-shrink: 0;
}
.aedoc-step.done .num { background: var(--brand); color: #fff; font-size: 11px; }
.aedoc-step.active .num { background: var(--brand); color: #fff; }
.aedoc-step .label, .aedoc-step .ttl {
  font-size: 12px; font-weight: 500; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.aedoc-step.active .label, .aedoc-step.active .ttl { color: var(--ink); font-weight: 600; }
.aedoc-step:hover:not(.active) .label,
.aedoc-step:hover:not(.active) .ttl { color: var(--ink-2); }

/* Legacy bullet stepper styles preserved for any view that still uses them */
.aedoc-step .connector { display: none; }
.aedoc-step .bullet {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  z-index: 1;
}
.aedoc-step.done .bullet { background: var(--brand); border-color: var(--brand); color: #fff; }
.aedoc-step.active .bullet { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-ring); }

/* ── Section head + intro ─────────────────────────────────── */
.aedoc-intro, .aedoc-section-head { margin-bottom: 20px; }
.aedoc-eyebrow { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; margin-bottom: 10px; }
.aedoc-eyebrow b { color: var(--brand); }
.aedoc-intro h2, .aedoc-section-head h2 {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 8px 0;
  color: var(--ink);
}
.aedoc-intro p, .aedoc-section-head p {
  font-size: 14px; color: var(--muted);
  margin: 0; max-width: 620px; line-height: 1.55;
  text-wrap: pretty;
}

/* ── Two-column layout (form + sidebar) ───────────────────── */
.aedoc-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 1000px) {
  .aedoc-layout { grid-template-columns: 1fr; }
}

.aedoc-sidebar { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1000px) {
  .aedoc-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .aedoc-side-card { flex: 1; min-width: 240px; }
}

.aedoc-side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.aedoc-side-card .lbl {
  font-size: 11px; color: var(--muted);
  letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 10px;
}
.aedoc-progress-num {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--f-display); font-weight: 700;
  color: var(--ink); margin-bottom: 12px;
}
.aedoc-progress-num .big {
  font-size: 36px; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.aedoc-progress-num .of { font-size: 16px; color: var(--muted); font-weight: 400; }

.aedoc-toc { display: flex; flex-direction: column; gap: 2px; }
.aedoc-toc-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s;
  border: none; background: transparent;
  width: 100%; text-align: left;
}
.aedoc-toc-item:hover { background: var(--bg-subtle); }
.aedoc-toc-item .mark {
  width: 16px; height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
  background: var(--border); color: var(--muted);
}
.aedoc-toc-item.done .mark { background: var(--success); color: #fff; }
.aedoc-toc-item.cur, .aedoc-toc-item.active { background: var(--brand-soft); }
.aedoc-toc-item.cur .mark, .aedoc-toc-item.active .mark { background: var(--brand); color: #fff; }
.aedoc-toc-item.cur .name, .aedoc-toc-item.active .name { color: var(--ink); font-weight: 600; }
.aedoc-toc-item .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aedoc-toc-item.optional .name::after {
  content: "opzionale";
  margin-left: 8px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
  font-weight: 600;
}

/* ── Sticky header progress (legacy in-page) ──────────────── */
.aedoc-progress {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 76px;
  z-index: 15;
  backdrop-filter: saturate(1.2) blur(6px);
}
.aedoc-progress .grow { flex: 1; }
.aedoc-progress .row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.aedoc-progress .row .left { color: var(--ink); font-weight: 500; }
.aedoc-progress .row .right { color: var(--muted); }
.aedoc-track { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.aedoc-fill { height: 100%; background: var(--brand); transition: width 0.4s ease; }
.aedoc-progress .time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ── Cards ────────────────────────────────────────────────── */
.aedoc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 92px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.aedoc-card:focus-within { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.aedoc-card.tone-info,
.aedoc-card.tone-warn {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.aedoc-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.aedoc-card-head .left { display: flex; gap: 14px; align-items: flex-start; }
.aedoc-card-num {
  width: 28px; height: 28px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.aedoc-card.done .aedoc-card-num { background: var(--success-bg); color: var(--success); }
.aedoc-card.done .aedoc-card-num::after { content: "✓"; font-size: 13px; }
.aedoc-card.done .aedoc-card-num span { display: none; }

.aedoc-card h3 {
  font-family: var(--f-body);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}
.aedoc-card .subtitle {
  font-size: 13px; color: var(--muted);
  margin: 4px 0 0 0;
  line-height: 1.45;
  text-wrap: pretty;
}
.aedoc-card-head .right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.tag-optional, .tag-fields, .tag-field-count {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.tag-active {
  font-size: 10px;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Form atoms ──────────────────────────────────────────── */
.field { width: 100%; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-row .field { margin-bottom: 0; }
.field-row { display: grid; gap: 16px; margin-bottom: 16px; }
.field-row:last-child { margin-bottom: 0; }
.field-row:not(:has(> :not([hidden]))) { display: none; }
.field-row.cols-1 { grid-template-columns: 1fr 1fr; }
.field-row.cols-1 > * { grid-column: 1; }
.field-row.cols-2 { grid-template-columns: 1fr 1fr; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field-row.col-2-1 { grid-template-columns: 2fr 1fr; }
.field-row.col-small { grid-template-columns: 130px 1fr; }
@media (max-width: 700px) {
  .field-row.cols-2, .field-row.cols-3, .field-row.col-2-1, .field-row.col-small { grid-template-columns: 1fr; }
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.field-label, label.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.req { color: var(--brand); margin-left: 3px; }
.hint { font-size: 12px; color: var(--muted); }

.control {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink-2);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.control::placeholder { color: var(--muted-soft); }
.control:hover { border-color: var(--border-strong); }
.control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.control.error { border-color: var(--error); }
.control.error:focus { box-shadow: 0 0 0 3px rgba(229,72,77,0.15); }

.control-wrap { position: relative; display: flex; align-items: stretch; }
.control-wrap .prefix {
  display: flex; align-items: center;
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--r-md) 0 0 var(--r-md);
  background: var(--bg-subtle);
  white-space: nowrap;
}
.control-wrap .prefix + .control { border-radius: 0 var(--r-md) var(--r-md) 0; }
.control-wrap .suffix {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted-soft);
  letter-spacing: 0.06em;
  pointer-events: none;
  font-weight: 600;
  text-transform: uppercase;
}

select.control {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%235A6478' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
textarea.control {
  height: auto;
  min-height: 92px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}

.error-msg { font-size: 12px; color: var(--error); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.error-msg .bang {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--error); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}

/* ── Toggle Sì/No ────────────────────────────────────────── */
.toggle-group {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
  background: var(--surface);
}
.toggle-group button {
  border: none;
  background: transparent;
  padding: 7px 22px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.toggle-group button.active-yes { background: var(--brand); color: #fff; }
.toggle-group button.active-no { background: var(--ink); color: #fff; }
.toggle-group button:not(.active-no):not(.active-yes):hover { background: var(--bg-subtle); }

/* ── Checkbox / radio group ──────────────────────────────── */
.checkbox-group, .radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 18px;
}
.checkbox-item, .radio-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-2);
  transition: border-color 0.12s, background 0.12s;
}
.checkbox-item:hover, .radio-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.checkbox-item input[type="checkbox"], .radio-item input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.radio-item:has(input:checked), .checkbox-item:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}

/* ── Signature pad ───────────────────────────────────────── */
.signature-wrap { border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); padding: 8px; }
.signature-canvas { display: block; width: 100%; height: 160px; background: var(--bg-subtle); border-radius: var(--r-md); cursor: crosshair; touch-action: none; }
.signature-actions { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 0; }
.signature-hint { color: var(--muted); font-size: 12px; }

/* ── Conditional disclose ────────────────────────────────── */
.conditional {
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  animation: aedoc-slideDown 0.25s ease-out;
}
@keyframes aedoc-slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.cond-eyebrow {
  font-size: 10.5px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.cond-eyebrow::before { content: "↳"; font-size: 14px; letter-spacing: 0; }
.sub-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; }
.sub-divider::before, .sub-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.sub-divider span {
  font-size: 10.5px;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ── Dropzone (form upload, layout centrato) ──────────────── */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 24px;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: block;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .icon, .dropzone .ic-up {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
}
.dropzone .text { display: block; }
.dropzone .text .primary,
.dropzone .lbl {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 2px;
}
.dropzone .text .primary .link,
.dropzone .lbl em,
.dropzone .lbl .link {
  font-style: normal;
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.dropzone .text .secondary,
.dropzone .meta {
  font-size: 11px;
  color: var(--muted-soft);
  margin-top: 4px;
}
.dropzone.uploaded {
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  padding: 14px;
  border-style: solid;
  border-color: var(--success-border);
  background: var(--success-bg);
}
.dropzone.uploaded:hover { border-color: var(--success); background: var(--success-bg); }
.dropzone.uploaded .icon, .dropzone.uploaded .ic-up {
  width: 32px; height: 40px;
  border-radius: 4px;
  background: #fff;
  color: var(--success);
  border: 1px solid var(--success-border);
  margin: 0;
}
.dropzone.uploaded .text { flex: 1; min-width: 0; }
.dropzone.uploaded .text .primary,
.dropzone.uploaded .lbl {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 0;
}
.dropzone.uploaded .text .secondary,
.dropzone.uploaded .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dropzone .file-actions { display: flex; align-items: center; gap: 4px; }
.dropzone .file-actions button {
  border: none; background: transparent;
  font-size: 12px; color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.dropzone .file-actions button:hover { background: var(--bg-subtle); color: var(--ink-2); }
.dropzone .file-actions button.danger:hover { color: var(--error); background: var(--error-bg); }

/* ── Footer nav (form pages) ──────────────────────────────── */
.aedoc-footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.aedoc-footer-nav .right { display: flex; align-items: center; gap: 12px; }
.aedoc-footer-nav .status { font-size: 12px; color: var(--muted); margin-right: 6px; }
.aedoc-footer-nav .status b { color: var(--ink); font-weight: 600; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-ghost,
.gd-btn, .gd-btn-primary, .gd-btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: var(--f-body);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary, .gd-btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover, .gd-btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active, .gd-btn-primary:active { background: var(--brand-press); }
.btn-secondary, .gd-btn-secondary {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border);
}
.btn-secondary:hover, .gd-btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  border-color: transparent;
}
.btn-ghost:hover { color: var(--ink-2); }
.btn-danger {
  background: var(--error);
  color: #fff;
  border: none;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-danger:hover { background: #c63339; }

button:disabled, .btn-primary:disabled, .btn-secondary:disabled,
[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* ── Toast ────────────────────────────────────────────────── */
.aedoc-toast {
  position: fixed;
  bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 13px;
  box-shadow: var(--shadow-popover);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(.3,1.4,.4,1), opacity 0.2s;
  z-index: 100;
  display: flex; align-items: center; gap: 10px;
}
.aedoc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.aedoc-toast .check {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--success); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

.ic { width: 18px; height: 18px; flex-shrink: 0; }
.ic-sm { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Alerts (flash banners) ───────────────────────────────── */
.aedoc-alert {
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink-2);
}
.aedoc-alert.success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.aedoc-alert.danger  { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.aedoc-alert.info    { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.aedoc-alert.warning { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }

/* ── Backoffice: filter chips ─────────────────────────────── */
.aedoc-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.aedoc-filter-chip {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.aedoc-filter-chip:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.aedoc-filter-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.aedoc-filter-chip .count {
  background: rgba(255,255,255,0.18);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 11px;
}
.aedoc-filter-chip:not(.active) .count {
  background: var(--bg-subtle);
  color: var(--muted);
}

/* ── Backoffice: status pill (AASM states) ────────────────── */
.aedoc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 500;
  background: var(--pill-slate-bg);
  color: var(--pill-slate);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.aedoc-status-pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.aedoc-status-pill.blue   { color: var(--pill-blue);   background: var(--pill-blue-bg);   border-color: var(--pill-blue); }
.aedoc-status-pill.green  { color: var(--pill-green);  background: var(--pill-green-bg);  border-color: var(--pill-green); }
.aedoc-status-pill.violet { color: var(--pill-violet); background: var(--pill-violet-bg); border-color: var(--pill-violet); }
.aedoc-status-pill.amber  { color: var(--pill-amber);  background: var(--pill-amber-bg);  border-color: var(--pill-amber); }
.aedoc-status-pill.coral  { color: var(--pill-coral);  background: var(--pill-coral-bg);  border-color: var(--pill-coral); }
.aedoc-status-pill.slate  { color: var(--pill-slate);  background: var(--pill-slate-bg);  border-color: var(--border); }
.aedoc-status-pill.gray   { color: var(--muted);       background: var(--bg-subtle);      border-color: var(--border); }

/* ── Backoffice: table ─────────────────────────────────────── */
.aedoc-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.aedoc-table { width: 100%; border-collapse: collapse; }
.aedoc-table thead th {
  background: var(--bg-subtle);
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.aedoc-table tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
  color: var(--ink-2);
  vertical-align: middle;
}
.aedoc-table tbody tr:last-child td { border-bottom: none; }
.aedoc-table tbody tr:hover td { background: var(--bg-hover); }
.aedoc-table tbody tr td:first-child { font-weight: 500; color: var(--ink); }
.aedoc-table .meta-row { font-size: 12px; color: var(--muted); margin-top: 2px; }
.aedoc-table-empty { padding: 48px 24px; text-align: center; color: var(--muted); font-size: 14px; }

.aedoc-table-actions { display: flex; gap: 8px; }
.aedoc-table-actions a, .aedoc-table-actions button {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.aedoc-table-actions a:hover, .aedoc-table-actions button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.aedoc-table-wrapper { overflow-x: auto; }

/* ── Backoffice: search input ─────────────────────────────── */
.aedoc-search-input {
  width: 100%;
  max-width: 480px;
  height: 44px;
  padding: 0 16px 0 44px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 14px;
  color: var(--ink-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239098A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 16px center;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.aedoc-search-input::placeholder { color: var(--muted-soft); }
.aedoc-search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

/* ── Backoffice: large upload zone (CSV import) ──────────── */
.aedoc-upload-zone {
  display: block;
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 48px;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s;
}
.aedoc-upload-zone:hover { border-color: var(--brand); background: var(--brand-soft); }
.aedoc-upload-zone .icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.aedoc-upload-zone .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.aedoc-upload-zone .subtitle { font-size: 13px; color: var(--muted); }
.aedoc-upload-zone .subtitle .link { color: var(--brand); text-decoration: underline; font-weight: 500; }
.aedoc-upload-zone input[type="file"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Backoffice: report table ─────────────────────────────── */
.aedoc-report-table { overflow-x: auto; }
.aedoc-report-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.aedoc-report-table thead th {
  background: var(--bg-subtle);
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  text-align: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.aedoc-report-table thead th:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-subtle); z-index: 1; }
.aedoc-report-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.aedoc-report-table tbody td:first-child {
  text-align: left;
  font-weight: 500;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
}
.aedoc-report-table tbody tr:hover td { background: var(--bg-hover); }
.aedoc-report-table tbody tr:hover td:first-child { background: var(--bg-hover); }
.aedoc-report-table tbody td.total {
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--ink);
}
.aedoc-report-table tbody tr.row-total td { background: var(--bg-subtle); font-weight: 700; }
.aedoc-report-table tbody tr.row-total td:first-child { background: var(--bg-subtle); }

/* ── Login card ──────────────────────────────────────────── */
.aedoc-login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-page);
  padding: 24px;
}
.aedoc-login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-sm);
}
.aedoc-login-header { text-align: center; margin-bottom: 32px; }
.aedoc-login-logo {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.3px;
}
.aedoc-login-logo img { width: 32px; height: 32px; }
.aedoc-login-logo .lt { font-weight: 400; color: var(--brand); }
.aedoc-login-title {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}
.aedoc-login-subtitle { font-size: 13px; color: var(--muted); margin: 0; }
.aedoc-login-form { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.aedoc-login-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.aedoc-login-checkbox input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--brand); }
.aedoc-login-footer { margin-top: 16px; text-align: center; font-size: 13px; }
.aedoc-login-footer a { color: var(--brand); }
.aedoc-login-footer a:hover { text-decoration: underline; }

/* OTP slots */
.otp-slots { display: flex; gap: 10px; justify-content: center; margin: 8px 0; }
.otp-slots input {
  width: 44px; height: 52px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  outline: none;
}
.otp-slots input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }

/* ── BO timeline (cronologia revisioni / stati) ────────────── */
.aedoc-timeline { display: flex; flex-direction: column; gap: 10px; }
.aedoc-timeline-item {
  display: flex; gap: 10px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.aedoc-timeline-item:last-child { border-bottom: none; }
.aedoc-timeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted-soft);
  flex-shrink: 0;
  margin-top: 6px;
}
.aedoc-timeline-dot.brand   { background: var(--brand); }
.aedoc-timeline-dot.success { background: var(--success); }
.aedoc-timeline-dot.warn    { background: var(--warning); }
.aedoc-timeline-dot.danger  { background: var(--error); }
.aedoc-timeline-dot.violet  { background: var(--pill-violet); }
.aedoc-timeline-body { flex: 1; min-width: 0; }
.aedoc-timeline-body .ttl { font-weight: 500; color: var(--ink); }
.aedoc-timeline-body .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.aedoc-timeline-body .note { font-size: 12px; color: var(--ink-2); margin-top: 4px; padding: 8px; background: var(--bg-subtle); border-radius: var(--r-sm); }

/* ── Read-only mode (BO review) ─────────────────────────────── */
.aedoc-readonly { opacity: 1 !important; }
.aedoc-readonly .control,
.aedoc-readonly select,
.aedoc-readonly input,
.aedoc-readonly textarea {
  background: var(--bg-subtle) !important;
  color: var(--ink-2) !important;
  cursor: default !important;
}
.aedoc-readonly .toggle-group button { cursor: default !important; }
.aedoc-readonly .toggle-group button.active-yes { background: var(--brand); color: #fff; }
.aedoc-readonly .toggle-group button.active-no { background: var(--ink); color: #fff; }
.aedoc-readonly .checkbox-item input[type="checkbox"]:checked + span,
.aedoc-readonly .radio-item input[type="radio"]:checked + span {
  font-weight: 600;
  color: var(--ink);
}
.aedoc-readonly .aedoc-step { cursor: pointer !important; pointer-events: auto !important; }
.aedoc-readonly .aedoc-step .bullet,
.aedoc-readonly .aedoc-step .label,
.aedoc-readonly .aedoc-step .connector { pointer-events: auto; }

/* Utility */
.muted { color: var(--muted); }
.tabular-nums { font-variant-numeric: tabular-nums; }
.uppercase-sm { text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px; }

/* ──────────────────────────────────────────────────────────
   Landing apex — marketing B2B (Pencil V7jLR)
   Identità tipografica dedicata: Space Grotesk + Inter.
   Namespace `.dfl-*` (Dichiarazione Facile Landing) — non
   condivide token con `.aedoc-*` perché la landing ha la
   propria palette (royal blue scuro #1E3A8A, sezioni dark
   gradienti) distinta dal prodotto interno.
   ────────────────────────────────────────────────────────── */

.dfl-page {
  background: #FFFFFF;
  color: #0D0D0D;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
}
.dfl-page * { box-sizing: border-box; }
.dfl-page a:not(.dfl-btn) { color: inherit; text-decoration: none; }
.dfl-page a.dfl-btn { text-decoration: none; }
.dfl-page :is(h1, h2, h3) {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  margin: 0;
}
.dfl-page p { margin: 0; }
.dfl-page ul { margin: 0; padding: 0; list-style: none; }
.dfl-page button { font-family: inherit; cursor: pointer; border: 0; }

.dfl-shell { max-width: 1440px; margin-inline: auto; }

/* ── Header ─────────────────────────────────────────────── */
.dfl-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; padding: 0 60px;
  background: #FFFFFF; border-bottom: 1px solid #E8E8E8;
}
.dfl-logo { display: flex; align-items: center; gap: 8px; }
.dfl-logo-mark {
  width: 28px; height: 28px; background: #1E3A8A;
  display: flex; align-items: center; justify-content: center;
  color: #FFF; font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 16px;
}
.dfl-logo-text {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600; font-size: 18px; color: #0D0D0D;
}
.dfl-nav { display: flex; align-items: center; gap: 36px; }
.dfl-nav a { font-size: 15px; font-weight: 500; color: #1A1A1A; }
.dfl-nav a:hover { color: #1E3A8A; }
.dfl-header-actions { display: flex; align-items: center; gap: 20px; }
.dfl-link { font-size: 15px; font-weight: 500; color: #374151; }
.dfl-link:hover { color: #1E3A8A; }

/* ── Buttons ────────────────────────────────────────────── */
.dfl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-weight: 600; font-size: 14px; line-height: 1;
  padding: 11px 22px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
  white-space: nowrap;
}
.dfl-btn:active { transform: translateY(1px); }
.dfl-btn--dark { background: #0D0D0D; color: #FFF; }
.dfl-btn--dark:hover { background: #1A1A1A; }
.dfl-btn--brand { background: #1E3A8A; color: #FFF; }
.dfl-btn--brand:hover { background: #1E4FB5; }
.dfl-btn--ghost { background: #FFFFFF; color: #0D0D0D; border-color: #E8E8E8; }
.dfl-btn--ghost:hover { border-color: #1E3A8A; color: #1E3A8A; }
.dfl-btn--lg { font-size: 15px; padding: 14px 28px; }
.dfl-btn--xl { font-size: 15px; padding: 16px 32px; }
.dfl-btn--dark-bordered { background: #0D0D0D; color: #7A7A7A; border-color: #2D2D2D; }
.dfl-btn--dark-bordered:hover { color: #FFFFFF; border-color: #4A4A4A; }
.dfl-btn--outline-light { background: transparent; color: #FFFFFF; border-color: rgba(255,255,255,0.3); }
.dfl-btn--outline-light:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

/* ── Hero ────────────────────────────────────────────────── */
.dfl-hero {
  background: #F8FAFF; border: 1px solid #E8E8E8;
  padding: 80px;
}
.dfl-hero-grid {
  display: grid; grid-template-columns: 1fr 560px; gap: 64px; align-items: stretch;
}
.dfl-hero-left {
  background: #F0F4FF; border-radius: 16px; padding: 32px 40px;
  display: flex; flex-direction: column; gap: 32px; justify-content: center;
}
.dfl-hero-content { display: flex; flex-direction: column; gap: 20px; }
.dfl-badge {
  display: inline-flex; width: fit-content;
  padding: 6px 12px; background: #EEF2FF; border: 1px solid #C7D2FE;
  font-size: 12px; font-weight: 500; color: #1E3A8A;
}
.dfl-hero-h1 {
  font-size: 48px; font-weight: 700; line-height: 1.1; letter-spacing: -1px;
  color: #0D0D0D;
}
.dfl-hero-sub {
  font-size: 16px; line-height: 1.6; color: #7A7A7A;
}
.dfl-cta-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.dfl-hero-right {
  background: #0F172A; height: 400px; position: relative;
  overflow: hidden;
}

/* ── Hero dashboard mockup ─────────────────────────────── */
.dfl-mockup {
  position: absolute; left: 20px; top: 34px; width: 520px; height: 332px;
  background: #FFFFFF; border: 1px solid #E8E8E8;
  display: flex; flex-direction: column; padding: 8px 0;
}
.dfl-mockup-bar {
  height: 44px; padding: 0 16px; gap: 8px;
  display: flex; align-items: center;
}
.dfl-mockup-bar--bottom { border-top: 1px solid #E8E8E8; }
.dfl-mockup-chip {
  width: 22px; height: 22px; background: #1D4ED8; color: #FFF;
  font-size: 9px; font-weight: 700; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Inter", sans-serif;
}
.dfl-mockup-brand { font-size: 11px; font-weight: 600; color: #0D0D0D; }
.dfl-mockup-status {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; background: #EFF6FF; border-radius: 100px;
  font-size: 10px; color: #3B82F6;
}
.dfl-mockup-status .dot {
  width: 6px; height: 6px; border-radius: 50%; background: #22C55E;
  display: inline-block;
}
.dfl-mockup-divider { height: 1px; background: #E8E8E8; }
.dfl-mockup-thead {
  background: #F8FAFC; height: 28px; padding: 0 16px;
  display: grid; grid-template-columns: 175px 65px 88px 1fr; align-items: center;
}
.dfl-mockup-thead span {
  font-size: 9px; font-weight: 600; color: #94A3B8;
  letter-spacing: 0.04em;
}
.dfl-mockup-row {
  height: 33px; padding: 0 16px;
  display: grid; grid-template-columns: 175px 65px 88px 1fr; align-items: center;
  gap: 8px;
}
.dfl-mockup-row--alt { background: #F8FAFC; }
.dfl-mockup-row .name { font-size: 11px; color: #0D0D0D; }
.dfl-mockup-row .type { font-size: 10px; color: #94A3B8; }
.dfl-mockup-row .status { font-size: 10px; font-weight: 500; }
.dfl-mockup-row .status.ok { color: #16A34A; }
.dfl-mockup-row .status.wait { color: #D97706; }
.dfl-mockup-row .status.req { color: #64748B; }
.dfl-mockup-row .status.ko { color: #DC2626; }
.dfl-mockup-row .progress {
  height: 4px; background: #E2E8F0; border-radius: 2px; overflow: hidden;
}
.dfl-mockup-row .progress > i {
  display: block; height: 100%; border-radius: 2px;
}
.dfl-mockup-row .progress > i.ok { background: #16A34A; }
.dfl-mockup-row .progress > i.wait { background: #F59E0B; }
.dfl-mockup-row .progress > i.req { background: #94A3B8; }
.dfl-mockup-row .progress > i.ko { background: #EF4444; }
.dfl-mockup-bar--bottom .info { font-size: 11px; color: #94A3B8; }
.dfl-mockup-cta {
  margin-left: auto; padding: 8px 16px; background: #1D4ED8; color: #FFFFFF;
  font-size: 11px; font-weight: 600; border-radius: 4px;
}

/* ── Problem section (dark) ────────────────────────────── */
.dfl-problem {
  background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%);
  padding: 80px;
}
.dfl-problem-header {
  display: flex; flex-direction: column; gap: 16px; padding: 16px 20px;
}
.dfl-eyebrow {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px; font-weight: 500; letter-spacing: 0.166em;
  text-transform: uppercase;
}
.dfl-eyebrow--blue { color: #1E3A8A; }
.dfl-eyebrow--soft-blue { color: #60A5FA; }
.dfl-eyebrow--light-blue { color: #93C5FD; }
.dfl-problem-h2 {
  font-size: 40px; font-weight: 600; line-height: 1.15; letter-spacing: -1px;
  color: #FFFFFF; max-width: 1100px;
}
.dfl-problem-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: #0F172A;
}
.dfl-problem-card {
  background: #1E2940; padding: 32px;
  display: flex; flex-direction: column; gap: 20px;
  border-left: 4px solid #3B82F6;
}
.dfl-problem-card .icon { color: #60A5FA; }
.dfl-problem-card h3 {
  color: #FFFFFF; font-size: 18px; font-weight: 600;
}
.dfl-problem-card p {
  color: #CBD5E1; font-size: 14px; line-height: 1.6;
  font-family: "Inter", sans-serif;
}

/* ── How It Works ──────────────────────────────────────── */
.dfl-how {
  background: linear-gradient(180deg, #F8FAFF 0%, #EEF2FF 100%);
  padding: 80px;
}
.dfl-section-head { display: flex; flex-direction: column; gap: 16px; }
.dfl-h2 {
  font-size: 40px; font-weight: 600; line-height: 1.15; letter-spacing: -1px;
  color: #0D0D0D;
}
.dfl-h2--xl { font-size: 52px; line-height: 1.1; letter-spacing: -2px; }
.dfl-how-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.dfl-step {
  padding: 32px; display: flex; flex-direction: column; gap: 20px;
  border-top: 4px solid #3B82F6;
}
.dfl-step + .dfl-step { border-right: 1px solid transparent; }
.dfl-step:not(:last-child) { border-right: 1px solid #E8E8E8; }
.dfl-step-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 48px; font-weight: 700; letter-spacing: -1px; color: #3B82F6;
  line-height: 1;
}
.dfl-step h3 { font-size: 18px; font-weight: 600; color: #0D0D0D; }
.dfl-step p { font-size: 14px; line-height: 1.6; color: #4B5563; }

/* ── Features ──────────────────────────────────────────── */
.dfl-features {
  background: linear-gradient(180deg, #EEF2FF 0%, #F8FAFF 100%);
  border: 1px solid #E8E8E8;
  padding: 96px 120px;
  display: flex; flex-direction: column; gap: 56px;
}
.dfl-features-head { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.dfl-features-head .sub { font-size: 16px; line-height: 1.5; color: #4B5563; }
.dfl-features-grid {
  display: grid; grid-template-columns: 1fr 1fr;
}
.dfl-feature {
  padding: 32px 28px; border: 1px solid #E8E8E8;
  display: flex; flex-direction: column; gap: 12px;
  background: #FFFFFF;
}
.dfl-feature--blue { background: #F0F7FF; }
.dfl-feature--dark { background: #0D0D0D; }
.dfl-feature .icon { color: #2563EB; }
.dfl-feature--dark .icon { color: #60A5FA; }
.dfl-feature h3 { font-family: "Inter", sans-serif; font-size: 15px; font-weight: 600; color: #0D0D0D; }
.dfl-feature p { font-size: 13px; line-height: 1.6; color: #7A7A7A; }
.dfl-feature--dark h3 { color: #FFFFFF; }
.dfl-feature--dark p { color: #94A3B8; }

/* ── Early Access ──────────────────────────────────────── */
.dfl-early {
  background: linear-gradient(135deg, #EEF2FF 0%, #F0F7FF 50%, #FFFFFF 100%);
  padding: 72px 120px;
  display: flex; flex-direction: column; gap: 48px;
}
.dfl-early-head { display: flex; flex-direction: column; gap: 16px; max-width: 800px; }
.dfl-early-head .sub { font-size: 16px; line-height: 1.6; color: #7A7A7A; }
.dfl-early-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.dfl-early-card {
  padding: 28px; border: 1px solid #E8E8E8; background: #FFFFFF;
  display: flex; flex-direction: column; gap: 20px;
}
.dfl-icon-box {
  width: 40px; height: 40px; background: #EEF2FF;
  display: inline-flex; align-items: center; justify-content: center;
  color: #1E3A8A;
}
.dfl-early-card h3 { font-size: 16px; font-weight: 600; color: #0D0D0D; }
.dfl-early-card p { font-size: 14px; line-height: 1.6; color: #7A7A7A; }
.dfl-early-cta { display: flex; gap: 24px; align-items: center; }
.dfl-early-cta-meta { font-size: 14px; color: #7A7A7A; }

/* ── Photo banner ──────────────────────────────────────── */
.dfl-photo {
  height: 280px; position: relative; overflow: hidden;
  background: #1E3A8A;
}
.dfl-photo > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.dfl-photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(30,58,138,0.93) 0%, rgba(30,58,138,0.53) 50%, rgba(15,23,42,0.80) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; gap: 16px; text-align: center;
}
.dfl-photo-overlay h3 {
  font-family: "Inter", sans-serif;
  font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -0.5px;
  color: #FFFFFF; max-width: 700px;
}
.dfl-photo-overlay p {
  font-size: 15px; line-height: 1.5; color: #BFDBFE; max-width: 500px;
}

/* ── Pricing / Contact ────────────────────────────────── */
.dfl-pricing {
  background: linear-gradient(180deg, #FFFFFF 0%, #F0F4FF 100%);
  padding: 96px 120px;
  display: flex; flex-direction: column; gap: 56px;
}
.dfl-pricing-head { display: flex; flex-direction: column; gap: 16px; max-width: 800px; }
.dfl-pricing-head .sub { font-size: 16px; line-height: 1.6; color: #7A7A7A; max-width: 600px; }
.dfl-pricing-layout {
  display: grid; grid-template-columns: 1fr 360px; gap: 32px; align-items: stretch;
}
.dfl-pricing-col-left { display: flex; flex-direction: column; gap: 0; }
.dfl-pricing-card {
  padding: 40px 36px; border: 1px solid #E8E8E8;
  display: flex; flex-direction: column; gap: 20px;
}
.dfl-pricing-card--white { background: #FFFFFF; }
.dfl-pricing-card--gray { background: #FAFAFA; }
.dfl-pricing-card .icon-row { display: flex; }
.dfl-pricing-card h3 { font-size: 18px; font-weight: 600; color: #0D0D0D; }
.dfl-pricing-card p { font-size: 14px; line-height: 1.6; color: #7A7A7A; }
.dfl-pricing-card .cta { width: fit-content; }

.dfl-trust-box {
  background: #0D0D0D; border: 1px solid #1A1A1A;
  padding: 40px 36px;
  display: flex; flex-direction: column; gap: 24px;
  color: #94A3B8;
}
.dfl-trust-box h4 {
  font-family: "Inter", sans-serif;
  font-size: 15px; font-weight: 600; color: #FFFFFF; margin: 0;
}
.dfl-trust-list { display: flex; flex-direction: column; gap: 14px; }
.dfl-trust-list li {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: #CBD5E1;
}
.dfl-trust-list .icon { color: #60A5FA; flex-shrink: 0; }
.dfl-trust-note { font-size: 12px; color: #475569; line-height: 1.5; }

/* ── Final CTA (dark) ──────────────────────────────────── */
.dfl-cta-final {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 60%, #1E1B4B 100%);
  padding: 120px;
  display: flex; flex-direction: column; align-items: center; gap: 40px;
  text-align: center;
}
.dfl-cta-final h2 {
  font-family: "Inter", sans-serif;
  color: #FFFFFF; max-width: 760px;
}
.dfl-cta-final .sub {
  font-size: 16px; line-height: 1.6; color: #CBD5E1; max-width: 560px;
}
.dfl-cta-final .trust-line { font-size: 12px; color: #475569; }

/* ── Footer ────────────────────────────────────────────── */
.dfl-footer {
  background: #0D0D0D; color: #94A3B8;
  display: flex; flex-direction: column;
}
.dfl-footer-top {
  padding: 64px 120px;
  display: grid; grid-template-columns: 280px 1fr; gap: 64px;
  border-bottom: 1px solid #1A1A1A;
}
.dfl-footer-brand { display: flex; flex-direction: column; gap: 20px; }
.dfl-footer-brand .logo { font-size: 16px; font-weight: 600; color: #FFFFFF; }
.dfl-footer-brand .tagline { font-size: 13px; line-height: 1.6; color: #94A3B8; max-width: 220px; }
.dfl-footer-brand .cert { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #64748B; }
.dfl-footer-brand .cert .icon { color: #1E3A8A; }
.dfl-footer-links {
  display: flex; gap: 48px; justify-content: flex-end;
}
.dfl-footer-col { display: flex; flex-direction: column; gap: 16px; }
.dfl-footer-col .title {
  font-size: 11px; font-weight: 500; color: #B0B0B0;
  letter-spacing: 0.083em; text-transform: uppercase;
}
.dfl-footer-col a { font-size: 13px; color: #94A3B8; }
.dfl-footer-col a:hover { color: #FFFFFF; }
.dfl-footer-bottom {
  padding: 20px 120px;
  display: flex; align-items: center; justify-content: space-between;
}
.dfl-footer-bottom .copy { font-size: 12px; color: #64748B; }
.dfl-footer-bottom .legal { display: flex; gap: 24px; }
.dfl-footer-bottom .legal a { font-size: 12px; color: #64748B; }
.dfl-footer-bottom .legal a:hover { color: #FFFFFF; }

/* ── Dev tenants strip (only in development) ───────────── */
.dfl-dev-strip {
  background: #FEF3C7; border-top: 1px solid #F59E0B;
  padding: 16px 120px; font-size: 12px; color: #78350F;
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
}
.dfl-dev-strip strong { font-weight: 600; }
.dfl-dev-strip a {
  background: #FFFFFF; padding: 4px 10px; border: 1px solid #FCD34D;
  border-radius: 4px; color: #78350F;
}
.dfl-dev-strip a:hover { border-color: #F59E0B; color: #1E3A8A; }

/* ── Responsive (mobile fTLbH) ────────────────────────── */
@media (max-width: 900px) {
  .dfl-header { padding: 0 24px; height: 60px; }
  .dfl-nav { display: none; }
  .dfl-header-actions .dfl-link { display: none; }
  .dfl-hero { padding: 48px 24px; }
  .dfl-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .dfl-hero-left { padding: 24px; gap: 20px; }
  .dfl-hero-h1 { font-size: 32px; letter-spacing: -0.5px; }
  .dfl-hero-right { height: 280px; }
  .dfl-mockup { width: calc(100% - 24px); left: 12px; top: 20px; height: 240px; }
  .dfl-mockup-thead { grid-template-columns: 1fr 50px 70px 1fr; }
  .dfl-mockup-row { grid-template-columns: 1fr 50px 70px 1fr; }
  .dfl-mockup-row .name { font-size: 10px; }
  .dfl-problem { padding: 48px 24px; }
  .dfl-problem-h2 { font-size: 28px; }
  .dfl-problem-grid { grid-template-columns: 1fr; gap: 1px; }
  .dfl-how { padding: 48px 24px; gap: 32px; }
  .dfl-how-grid { grid-template-columns: 1fr; }
  .dfl-step { border-right: 0 !important; border-bottom: 1px solid #E8E8E8; padding: 24px; }
  .dfl-step:last-child { border-bottom: 0; }
  .dfl-h2 { font-size: 28px; }
  .dfl-h2--xl { font-size: 32px; letter-spacing: -1px; }
  .dfl-features { padding: 56px 24px; gap: 32px; }
  .dfl-features-grid { grid-template-columns: 1fr; }
  .dfl-feature { padding: 24px; }
  .dfl-early { padding: 56px 24px; gap: 32px; }
  .dfl-early-grid { grid-template-columns: 1fr; gap: 16px; }
  .dfl-photo { height: 220px; }
  .dfl-photo-overlay h3 { font-size: 22px; }
  .dfl-photo-overlay p { font-size: 13px; }
  .dfl-pricing { padding: 56px 24px; gap: 32px; }
  .dfl-pricing-layout { grid-template-columns: 1fr; gap: 16px; }
  .dfl-pricing-card { padding: 28px 24px; }
  .dfl-trust-box { padding: 28px 24px; }
  .dfl-cta-final { padding: 64px 24px; }
  .dfl-cta-final h2 { font-size: 32px; line-height: 1.15; letter-spacing: -1px; }
  .dfl-footer-top { padding: 40px 24px; grid-template-columns: 1fr; gap: 32px; }
  .dfl-footer-links { justify-content: flex-start; flex-wrap: wrap; gap: 32px; }
  .dfl-footer-bottom {
    padding: 16px 24px; flex-direction: column; gap: 12px; align-items: flex-start;
  }
  .dfl-cta-row { flex-direction: column; align-items: stretch; }
  .dfl-cta-row .dfl-btn { width: 100%; }
  .dfl-early-cta { flex-direction: column; align-items: flex-start; gap: 16px; }
  .dfl-dev-strip { padding: 12px 24px; }
}
