/* ============================================================
   FirmaTranquilla — Design System
   ============================================================ */

/* ---- Tokens ------------------------------------------------ */
:root {
  --grad: linear-gradient(135deg, #a855f7 0%, #3b82f6 100%);
  --grad-subtle: linear-gradient(135deg, #faf5ff 0%, #eff6ff 100%);
  --clr-p1: #a855f7;
  --clr-p2: #3b82f6;
  --clr-text: #0f172a;
  --clr-muted: #64748b;
  --clr-placeholder: #94a3b8;
  --clr-border: #e2e8f0;
  --clr-border-focus: #a855f7;
  --clr-surface: #ffffff;
  --clr-bg: #f8fafc;
  --clr-bg-subtle: #f1f5f9;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.05);
  --shadow-lg: 0 4px 8px rgba(0,0,0,.05), 0 12px 32px rgba(0,0,0,.08);
}

/* ---- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
               Helvetica, Arial, sans-serif;
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--clr-p2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

.nav-brand img {
  display: block;
  height: 34px;
  width: auto;
}

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

.nav-links a {
  color: var(--clr-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--r-sm);
  transition: color .15s, background .15s;
}

.nav-links a:hover {
  color: var(--clr-text);
  background: var(--clr-bg-subtle);
  text-decoration: none;
}

.nav-logout { color: var(--clr-muted) !important; }

.nav-cta {
  background: var(--grad) !important;
  color: #fff !important;
  padding: 0.45rem 1.1rem !important;
  border-radius: var(--r-sm) !important;
  font-weight: 600 !important;
  transition: opacity .15s !important;
}

.nav-cta:hover {
  opacity: .88;
  background: var(--grad) !important;
  color: #fff !important;
  text-decoration: none !important;
}

/* ---- Hamburger -------------------------------------------- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-hamburger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger--open span:nth-child(2) { opacity: 0; }
.nav-hamburger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 600px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,.98);
    border-bottom: 1px solid var(--clr-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    border-radius: var(--r);
  }
  .nav-cta {
    margin-top: 0.25rem;
    text-align: center;
  }
}

/* ============================================================
   Main
   ============================================================ */
.main-content {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 1140px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================
   Flash messages
   ============================================================ */
.flash-container {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flash {
  padding: 0.8rem 1.1rem;
  border-radius: var(--r);
  font-size: 0.9rem;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: opacity .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-full { width: 100%; }

.btn-primary {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(168,85,247,.2);
}
.btn-primary:hover { opacity: .88; color: #fff; }

.btn-secondary {
  background: var(--clr-surface);
  color: var(--clr-text);
  border-color: var(--clr-border);
}
.btn-secondary:hover { background: var(--clr-bg-subtle); }

.btn-ghost {
  background: transparent;
  color: var(--clr-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--clr-bg-subtle); color: var(--clr-text); }

.btn-google {
  background: var(--clr-surface);
  color: var(--clr-text);
  border-color: var(--clr-border);
  font-weight: 500;
}
.btn-google:hover { background: var(--clr-bg-subtle); }

.btn-hero {
  padding: 0.8rem 2rem;
  font-size: 1rem;
  border-radius: var(--r);
}

.google-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--clr-text);
}

.form-optional { font-weight: 400; color: var(--clr-placeholder); }
.form-required { color: #ef4444; }

.form-input {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--clr-border);
  border-radius: var(--r-sm);
  font-size: 0.95rem;
  background: var(--clr-surface);
  color: var(--clr-text);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
  width: 100%;
}

.form-input::placeholder { color: var(--clr-placeholder); }

.form-input:focus {
  outline: none;
  border-color: var(--clr-p1);
  box-shadow: 0 0 0 3px rgba(168,85,247,.12);
}

.form-select { cursor: pointer; }
.form-textarea { resize: vertical; }

.form-group-checkbox .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: var(--clr-muted);
  cursor: pointer;
  line-height: 1.5;
}

.form-group-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--clr-p1);
  cursor: pointer;
}

/* ============================================================
   Auth pages
   ============================================================ */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2.5rem;
}

.auth-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}

.auth-card-conflict { text-align: center; }

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--clr-text);
  letter-spacing: -.03em;
  margin-bottom: 0.3rem;
}

.auth-subtitle {
  color: var(--clr-muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-divider {
  text-align: center;
  position: relative;
  margin: 1.25rem 0;
  color: var(--clr-placeholder);
  font-size: 0.8rem;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--clr-border);
}

.auth-divider span {
  position: relative;
  background: var(--clr-surface);
  padding: 0 0.75rem;
}

.auth-footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--clr-muted);
}

/* ============================================================
   Conflict page
   ============================================================ */
.conflict-icon    { font-size: 2.5rem; margin-bottom: 1rem; }
.conflict-message { color: var(--clr-muted); margin-bottom: 1.75rem; line-height: 1.7; font-size: 0.95rem; }
.conflict-actions { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }

/* ============================================================
   Landing — Hero
   ============================================================ */
.hero {
  margin: -2rem -1.5rem 0;
  padding: 5.5rem 1.5rem 4.5rem;
  background: var(--clr-surface);
  text-align: center;
  border-bottom: 1px solid var(--clr-border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-subtle);
  opacity: .6;
}

.hero-inner {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 99px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clr-p1);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  background: var(--grad);
  border-radius: 50%;
  display: inline-block;
}

.hero-headline {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -.04em;
  color: var(--clr-text);
  margin-bottom: 1.25rem;
}

.hero-headline-accent {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--clr-muted);
  max-width: 560px;
  margin: 0 auto 2.25rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-disclaimer {
  font-size: 0.78rem;
  color: var(--clr-placeholder);
  max-width: 460px;
  margin: 0 auto;
}

/* ============================================================
   Landing — Sections
   ============================================================ */
.section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--clr-border);
}

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

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--clr-p1);
  margin-bottom: 0.75rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--clr-text);
  margin-bottom: 0.6rem;
}

.section-subtitle {
  color: var(--clr-muted);
  margin-bottom: 3rem;
  font-size: 1rem;
  max-width: 540px;
}

/* Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}

.step-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: 1.75rem 1.5rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--grad);
  color: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.step-title { font-size: 0.95rem; font-weight: 700; color: var(--clr-text); margin-bottom: 0.4rem; }
.step-desc  { font-size: 0.875rem; color: var(--clr-muted); line-height: 1.65; }

/* Red flag examples */
.flags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.flag-example {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.flag-example h4 { font-size: 0.9rem; font-weight: 700; color: var(--clr-text); margin: 0.5rem 0 0.35rem; }
.flag-example p  { font-size: 0.85rem; color: var(--clr-muted); line-height: 1.6; }

.flag-severity {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.flag-alta  { background: #fef2f2; color: #b91c1c; }
.flag-media { background: #fffbeb; color: #b45309; }
.flag-bassa { background: #f0fdf4; color: #15803d; }

/* Contract types */
.types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.type-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r);
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}

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

.type-icon { font-size: 1.75rem; margin-bottom: 0.6rem; }
.type-card h4 { font-size: 0.875rem; font-weight: 700; color: var(--clr-text); margin-bottom: 0.35rem; }
.type-card p  { font-size: 0.8rem; color: var(--clr-muted); line-height: 1.55; }

/* CTA section */
.cta-section {
  text-align: center;
  padding: 5rem 0;
  border-bottom: none;
}

.cta-title    { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 0.75rem; }
.cta-subtitle { color: var(--clr-muted); margin-bottom: 2rem; }

/* ============================================================
   Legal pages
   ============================================================ */
.legal-container {
  max-width: 780px;
  margin: 0 auto;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.legal-title   { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 0.25rem; }
.legal-updated { font-size: 0.8rem; color: var(--clr-placeholder); margin-bottom: 2rem; }

.legal-body h2 { font-size: 1rem; font-weight: 700; color: var(--clr-p1); margin-top: 1.75rem; margin-bottom: 0.5rem; }
.legal-body p  { font-size: 0.9rem; color: #374151; line-height: 1.75; margin-bottom: 0.75rem; }
.legal-body ul { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.legal-body li { font-size: 0.9rem; color: #374151; line-height: 1.7; margin-bottom: 0.3rem; }

/* ============================================================
   Page header
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-title    { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; color: var(--clr-text); }
.page-subtitle { font-size: 0.875rem; color: var(--clr-muted); margin-top: 0.2rem; }
.page-header-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-label { font-weight: 500; }

.badge-risk-alto   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-risk-medio  { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-risk-basso  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.badge-status { font-weight: 600; border: 1px solid transparent; }
.badge-status-uploaded        { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.badge-status-text_extracted  { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.badge-status-ocr_processing  { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.badge-status-ocr_done        { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.badge-status-analyzing       { background: #faf5ff; color: #7c3aed; border-color: #e9d5ff; }
.badge-status-analyzed        { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.badge-status-error           { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ============================================================
   Contracts list / table
   ============================================================ */
.table-wrapper {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.contracts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.contracts-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--clr-border);
  background: var(--clr-bg);
  white-space: nowrap;
}

.contracts-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: var(--clr-text);
}

.contracts-table tbody tr:last-child td { border-bottom: none; }
.contracts-table tbody tr:hover { background: var(--clr-bg); }

.td-date        { color: var(--clr-muted); white-space: nowrap; font-size: 0.82rem; }
.td-filename a  { font-weight: 600; color: var(--clr-text); }
.td-filename a:hover { color: var(--clr-p1); text-decoration: none; }
.td-counterparty { display: block; font-size: 0.78rem; color: var(--clr-placeholder); margin-top: 2px; }
.td-empty       { color: #cbd5e1; }
.td-actions     { white-space: nowrap; }

.action-link {
  color: var(--clr-p2);
  font-size: 0.82rem;
  font-weight: 500;
  margin-right: 0.75rem;
}
.action-link:hover { text-decoration: underline; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.empty-icon  { font-size: 3rem; margin-bottom: 1rem; }
.empty-title { font-size: 1.15rem; font-weight: 700; color: var(--clr-text); margin-bottom: 0.5rem; }
.empty-desc  { color: var(--clr-muted); margin-bottom: 2rem; font-size: 0.9rem; }

/* ============================================================
   Upload form
   ============================================================ */
.upload-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: 2rem 2.25rem;
  max-width: 680px;
  box-shadow: var(--shadow-sm);
}

.upload-form { display: flex; flex-direction: column; gap: 1.25rem; }

.file-drop-area {
  border: 2px dashed var(--clr-border);
  border-radius: var(--r);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s;
  background: var(--clr-bg);
}

.file-drop-area:hover,
.file-drop-area.drag-over {
  border-color: var(--clr-p1);
  background: #faf5ff;
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.file-drop-content { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; pointer-events: none; }
.file-drop-icon    { font-size: 2rem; margin-bottom: 0.25rem; }
.file-drop-text    { font-size: 0.9rem; color: var(--clr-muted); }
.file-drop-link    { color: var(--clr-p1); font-weight: 600; }
.file-drop-hint    { font-size: 0.8rem; color: var(--clr-placeholder); }

.file-selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--clr-text);
  pointer-events: none;
}

.file-selected-icon { font-size: 1.25rem; }
.file-remove-btn {
  pointer-events: all;
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

.consent-box {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: var(--r);
  padding: 1rem;
}

.consent-box-inline { margin-bottom: 0.5rem; }

.upload-actions { display: flex; justify-content: flex-end; padding-top: 0.5rem; }
.btn-upload { min-width: 190px; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

.spinner-large {
  display: block;
  width: 44px;
  height: 44px;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-p1);
  border-radius: 50%;
  animation: spin .9s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Contract detail — status card
   ============================================================ */
.status-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.status-icon  { font-size: 2.5rem; margin-bottom: 1rem; }
.status-title { font-size: 1.2rem; font-weight: 700; color: var(--clr-text); margin-bottom: 0.5rem; }
.status-desc  { color: var(--clr-muted); margin-bottom: 1.75rem; line-height: 1.6; font-size: 0.9rem; max-width: 440px; margin-left: auto; margin-right: auto; }

.status-card form { display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.status-card-error { border-color: #fecaca; background: #fef9f9; }
.status-card-error .status-title { color: #b91c1c; }

/* ============================================================
   Contract detail — results
   ============================================================ */
.truncation-notice {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--r);
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  color: #b45309;
  margin-bottom: 1.5rem;
}

.results-grid { margin-bottom: 2rem; }

/* Risk card */
.risk-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r-lg);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
  border-left-width: 5px;
}

.risk-card.risk-alto  { border-left-color: #ef4444; }
.risk-card.risk-medio { border-left-color: #f59e0b; }
.risk-card.risk-basso { border-left-color: #22c55e; }

.risk-score-circle { display: flex; align-items: baseline; gap: 3px; flex-shrink: 0; }
.risk-score-number { font-size: 3.75rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; }
.risk-score-max    { font-size: 1rem; color: var(--clr-muted); }

.risk-card.risk-alto  .risk-score-number { color: #b91c1c; }
.risk-card.risk-medio .risk-score-number { color: #b45309; }
.risk-card.risk-basso .risk-score-number { color: #15803d; }

.risk-info { flex: 1; min-width: 200px; }

.risk-level-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.risk-level-alto  { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.risk-level-medio { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.risk-level-basso { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

.risk-summary { color: var(--clr-muted); line-height: 1.7; font-size: 0.9rem; }

/* Results sections */
.results-section { margin-bottom: 2.5rem; }

.results-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-text);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Red flags */
.red-flags-list { display: flex; flex-direction: column; gap: 0.85rem; }

.red-flag-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r);
  padding: 1.1rem 1.4rem;
  border-left: 4px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
}

.red-flag-card.severity-alta  { border-left-color: #ef4444; }
.red-flag-card.severity-media { border-left-color: #f59e0b; }
.red-flag-card.severity-bassa { border-left-color: #22c55e; }

.red-flag-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.red-flag-title { font-size: 0.9rem; font-weight: 700; color: var(--clr-text); }

.severity-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.severity-badge-alta  { background: #fef2f2; color: #b91c1c; }
.severity-badge-media { background: #fffbeb; color: #b45309; }
.severity-badge-bassa { background: #f0fdf4; color: #15803d; }

.red-flag-clause      { font-size: 0.78rem; color: var(--clr-placeholder); margin-bottom: 0.4rem; }
.red-flag-quote       { border-left: 3px solid var(--clr-border); padding-left: 0.75rem; margin: 0.5rem 0; font-size: 0.85rem; color: var(--clr-muted); font-style: italic; }
.red-flag-explanation { font-size: 0.875rem; color: #374151; line-height: 1.65; margin-bottom: 0.4rem; }

.red-flag-suggestion,
.red-flag-question {
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.6;
  margin-top: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: var(--clr-bg);
  border-radius: var(--r-sm);
  border: 1px solid var(--clr-border);
}

/* Missing clauses */
.missing-list { display: flex; flex-direction: column; gap: 0.75rem; }

.missing-card {
  background: var(--clr-surface);
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: var(--r);
  padding: 0.9rem 1.2rem;
  box-shadow: var(--shadow-sm);
}

.missing-title      { font-size: 0.875rem; font-weight: 700; color: var(--clr-text); margin-bottom: 0.3rem; }
.missing-why        { font-size: 0.85rem; color: var(--clr-muted); line-height: 1.6; }
.missing-suggestion { font-size: 0.85rem; color: #374151; margin-top: 0.4rem; }

/* Positive points */
.positive-list { display: flex; flex-direction: column; gap: 0.75rem; }

.positive-card {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid #22c55e;
  border-radius: var(--r);
  padding: 0.9rem 1.2rem;
}

.positive-title       { font-size: 0.875rem; font-weight: 700; color: #166534; margin-bottom: 0.3rem; }
.positive-explanation { font-size: 0.85rem; color: #374151; line-height: 1.6; }

/* Questions */
.questions-list {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.questions-list li { font-size: 0.9rem; color: #374151; line-height: 1.6; }

/* Negotiation email */
.email-box {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.email-body {
  padding: 1.25rem 1.5rem;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.75;
  white-space: pre-wrap;
  border-bottom: 1px solid var(--clr-border);
}

.btn-copy { margin: 0.85rem 1.25rem; }

/* Result disclaimer */
.result-disclaimer {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  background: var(--clr-bg-subtle);
  border: 1px solid var(--clr-border);
  border-radius: var(--r);
  font-size: 0.8rem;
  color: var(--clr-placeholder);
  line-height: 1.6;
  text-align: center;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  padding: 2rem 1.5rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-left { display: flex; flex-direction: column; gap: 0.35rem; }

.footer-brand img { height: 26px; width: auto; display: block; }

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--clr-placeholder);
  max-width: 400px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links a {
  color: var(--clr-muted);
  font-size: 0.85rem;
  transition: color .15s;
}

.footer-links a:hover { color: var(--clr-text); text-decoration: none; }

/* ============================================================
   Pricing page
   ============================================================ */
.pricing-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.pricing-header {
  text-align: center;
  margin-bottom: 3rem;
}

.pricing-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--clr-text);
  margin-bottom: 0.75rem;
}

.pricing-subtitle {
  color: var(--clr-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.pricing-card {
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--r-xl);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}

.pricing-card:hover { box-shadow: var(--shadow-lg); }

.pricing-card--featured {
  border-color: var(--clr-p1);
  box-shadow: 0 0 0 3px rgba(168,85,247,.12), var(--shadow-lg);
}

.pricing-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--grad);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 14px;
  border-radius: 99px;
  white-space: nowrap;
}

.pricing-plan-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-text);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.pricing-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--clr-text);
  line-height: 1;
}

.pricing-currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-muted);
}

.pricing-desc {
  font-size: 0.875rem;
  color: var(--clr-muted);
  line-height: 1.5;
  min-height: 2.5rem;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.pricing-features li {
  font-size: 0.875rem;
  color: var(--clr-text);
  padding-left: 1.3rem;
  position: relative;
}

.pricing-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--clr-p1);
  font-weight: 700;
}

.pricing-footer-note {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 0.875rem;
  color: var(--clr-muted);
  line-height: 1.7;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--clr-border);
  color: var(--clr-text);
}

.btn-outline:hover {
  border-color: var(--clr-p1);
  color: var(--clr-p1);
  text-decoration: none;
  background: rgba(168,85,247,.04);
}

.pricing-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.pricing-discount {
  background: #dcfce7;
  color: #16a34a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: .02em;
  white-space: nowrap;
  flex-shrink: 0;
}
