/* NIS2 Consult - Global Styles */
:root {
  --color-primary: #0b3c5d;
  --color-accent: #14b8a6;
  --color-dark: #0f172a;
  --color-muted: #64748b;
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;
  --color-border: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(2, 6, 23, 0.08);
  --max-w: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--color-dark);
  background: var(--color-bg);
  line-height: 1.6;
}
/* Ensure form controls use the same typography as the document */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--color-primary);
}
.brand__logo {
  width: 28px;
  height: 28px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav a {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--color-muted);
}
.nav a:hover, .nav a.active { color: var(--color-dark); background: var(--color-bg-alt); }

#nav-toggle { display: none; color: var(--color-dark); }
@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--color-bg); border-bottom: 1px solid var(--color-border); padding: 8px 16px; }
  .nav.open { display: grid; grid-template-columns: 1fr; gap: 8px; }
  #nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-bg); color: inherit; }
}

.hero {
  background: radial-gradient(1000px 600px at 80% -20%, rgba(20,184,166,0.15), transparent),
              linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid var(--color-border);
}
.hero--services {
  background: radial-gradient(900px 540px at 20% -20%, rgba(20,184,166,0.18), transparent),
              linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  padding: 48px 0 24px;
}
.hero h1 { font-size: 40px; line-height: 1.15; margin: 0 0 12px; color: var(--color-primary); }
.hero p { font-size: 18px; color: var(--color-muted); margin: 0 0 20px; }
.hero__card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}

.section { padding: 48px 0; }
.section--alt { background: var(--color-bg-alt); border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); }
.section__header { margin-bottom: 20px; }
.section__header h2 { margin: 0 0 8px; font-size: 28px; color: var(--color-primary); }
.section__header p { margin: 0; color: var(--color-muted); }

/* Stats */
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat { text-align: center; }
.stat__number {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  transition: transform 300ms ease;
}
.stat__label { color: var(--color-muted); margin-top: 6px; font-size: 14px; }
.stat:hover .stat__number { transform: translateY(-2px); }
@media (max-width: 900px) { .stats__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .stats__grid { grid-template-columns: 1fr; } }

.grid {
  display: grid;
  gap: 16px;
}
.grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid--cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid--cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1100px) {
  .grid--cols-5 { grid-template-columns: repeat(3, 1fr); }
  .grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .grid--cols-5, .grid--cols-4, .grid--cols-3, .grid--cols-2 { grid-template-columns: 1fr; }
}

/* Two-column compact lists */
.list-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  padding-left: 18px;
}
.list-2col li { margin: 4px 0; }
@media (max-width: 700px) { .list-2col { grid-template-columns: 1fr; } }

/* Clients groups */
.clients-groups { gap: 16px; }
.client-group ul { list-style: none; padding-left: 0; margin: 0; }
.client-group li { padding: 6px 0; border-bottom: 1px dashed var(--color-border); }
.client-group li:last-child { border-bottom: 0; }
.client-group .icon { width: 22px; height: 22px; color: var(--color-accent); }
.client-group__header { display: flex; align-items: center; gap: 10px; }

.card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card h3 { margin: 0 0 8px; }
.card p { margin: 0; color: var(--color-muted); }

/* Video player */
.video-player {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
  border-radius: inherit;
}

/* Services grid cards (links to tabs) */
.service-card {
  display: block;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.service-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-accent); }
.service-card h3 { color: var(--color-primary); }

/* Lightweight tilt effect */
.tilt { will-change: transform; }

.icon {
  width: 28px; height: 28px; color: var(--color-accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: white;
  font-weight: 600;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
  box-shadow: 0 10px 18px rgba(20,184,166,0.25);
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  word-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 24px rgba(20,184,166,0.3); }
.btn--ghost { background: transparent; color: var(--color-accent); }
/* Ensure icons inside buttons follow the button text color for proper contrast */
.btn .icon { color: currentColor; }

.kicker { color: var(--color-accent); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; }
.muted { color: var(--color-muted); }

.list-inline { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0; margin: 0; list-style: none; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--color-border); border-radius: 999px; background: white; color: var(--color-dark);
}

.footer { border-top: 1px solid var(--color-border); background: #0b3c5d; color: #e2f3f1; }
.footer a { color: #d1faf5; }
.footer__cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 16px; padding: 32px 0; }
.footer h4 { margin: 0 0 10px; }
.footer .small { color: #cbd5e1; font-size: 14px; }
@media (max-width: 900px) { .footer__cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer__cols { grid-template-columns: 1fr; } }

.form { display: grid; gap: 12px; }
.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
}
.textarea { min-height: 140px; resize: vertical; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .form__row { grid-template-columns: 1fr; } }
.form__hint { font-size: 13px; color: var(--color-muted); }
.form__error { color: #dc2626; font-size: 14px; }

.breadcrumbs { font-size: 14px; color: var(--color-muted); margin-bottom: 10px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border: 1px solid var(--color-border); padding: 10px; text-align: left; }
.table th { background: var(--color-bg-alt); }

.notice {
  padding: 12px 14px;
  border-left: 3px solid var(--color-accent);
  background: #ecfeff;
  border-radius: 8px;
}

.notice__title { font-weight: 700; margin: 0 0 4px; }
.notice__body { margin: 0; }
.notice--info { background: #eff6ff; border-left-color: #60a5fa; }
.notice--success { background: #ecfdf5; border-left-color: #34d399; }
.notice--warning { background: #fffbeb; border-left-color: #f59e0b; }
.notice--danger { background: #fef2f2; border-left-color: #ef4444; }
.notice--tip { background: #f0fdf4; border-left-color: #22c55e; }

.notice--compact { padding: 10px 12px; }
.notice .icon { width: 18px; height: 18px; }

:root[data-theme="dark"] .notice { background: rgba(20,184,166,0.1); }
:root[data-theme="dark"] .notice--info { background: rgba(59,130,246,0.12); border-left-color: #60a5fa; }
:root[data-theme="dark"] .notice--success { background: rgba(16,185,129,0.12); border-left-color: #34d399; }
:root[data-theme="dark"] .notice--warning { background: rgba(245,158,11,0.12); border-left-color: #f59e0b; }
:root[data-theme="dark"] .notice--danger { background: rgba(239,68,68,0.12); border-left-color: #ef4444; }
:root[data-theme="dark"] .notice--tip { background: rgba(34,197,94,0.12); border-left-color: #22c55e; }

/* Utilities */
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.pt-0 { padding-top: 0; }
.pt-2 { padding-top: 8px; }
.pt-6 { padding-top: 24px; }
.pb-6 { padding-bottom: 24px; }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Blog */
.post-card h3 { margin: 8px 0; }
.post-card time { color: var(--color-muted); font-size: 14px; }

/* Map */
.map-embed { width: 100%; height: 360px; border: 0; border-radius: var(--radius); }

/* Tabs */
.tabs { margin-top: 12px; }
.tabs__list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}
.tabs__tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--color-muted);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tabs__tab:hover { background: var(--color-bg-alt); color: var(--color-dark); }
.tabs__tab.is-active { background: var(--color-accent); border-color: var(--color-accent); color: #fff; box-shadow: 0 10px 18px rgba(20,184,166,0.25); }

.tabpanel { display: none; padding-top: 16px; }
.tabpanel.is-active { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }
@media (max-width: 900px) { .tabpanel.is-active { grid-template-columns: 1fr; } }

/* Accordion */
.accordion { display: grid; gap: 8px; margin-top: 12px; }
.accordion__item { border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-bg); }
.accordion__button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  font-weight: 600;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}
.accordion__button:hover { background: var(--color-bg-alt); }
.accordion__button:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 8px; }
.accordion__chevron { transition: transform 160ms ease; color: var(--color-accent); }
.accordion__button[aria-expanded="true"] .accordion__chevron { transform: rotate(180deg); }
.accordion__content { padding: 0 14px 12px; }
.accordion__content ul { margin: 8px 0 0; padding-left: 18px; }
.accordion__content li { color: var(--color-dark); margin: 6px 0; }
.accordion__content[hidden] { display: none; }

/* Interactive checklist + progress */
.checklist__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.checklist__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.progress {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 520px;
}
.progress__bar {
  position: relative;
  height: 10px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--value, 0%);
  background: linear-gradient(90deg, var(--color-accent), #22d3ee);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4);
}
.progress__label { font-size: 13px; color: var(--color-muted); white-space: nowrap; }

.checklist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--color-accent); }
.check span { color: var(--color-dark); }

@media (max-width: 700px) {
  .checklist__header { flex-direction: column; align-items: stretch; }
  .progress { max-width: none; }
  .checklist__actions { justify-content: flex-start; }
}

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 300ms ease, transform 300ms ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--color-border); }
.timeline__item { position: relative; padding-left: 32px; margin-bottom: 16px; }
.timeline__item::before { content: ""; position: absolute; left: 4px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--color-accent); box-shadow: var(--shadow-sm); }
.timeline__item h4 { margin: 0 0 4px; }

/* Modal */
body.no-scroll { overflow: hidden; }
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 100; }
.modal.is-open { display: flex; }
.modal__overlay { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.55); backdrop-filter: blur(2px); }
.modal__dialog { position: relative; width: 96%; max-width: 1100px; height: 90vh; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden; display: flex; flex-direction: column; }
.modal__header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--color-border); background: var(--color-bg-alt); }
.modal__title { margin: 0; font-size: 16px; color: var(--color-primary); }
.modal__close { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg); cursor: pointer; color: var(--color-dark); }
.modal__body { position: relative; flex: 1; }
.modal__iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

/* Chatbot widget */
.chatbot-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 10px 18px rgba(20,184,166,0.28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chatbot-launcher:hover { transform: translateY(-1px); }
.chatbot-launcher svg { width: 24px; height: 24px; }

.chatbot {
  position: fixed;
  right: 20px;
  bottom: 90px; /* leave space above launcher */
  z-index: 200;
  width: min(420px, 92vw);
  height: min(600px, 80vh);
  display: none;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: var(--color-bg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.chatbot.is-open { display: flex; flex-direction: column; }
.chatbot__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border);
}
.chatbot__title { margin: 0; font-size: 15px; color: var(--color-primary); }
.chatbot__actions { display: flex; gap: 6px; }
.chatbot__btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--color-border);
  background: var(--color-bg); color: var(--color-dark); cursor: pointer;
}
.chatbot__body { flex: 1; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); overflow: auto; display: grid; gap: 10px; background: var(--color-bg); }
.chatbot__msg { display: grid; gap: 4px; max-width: 90%; }
.chatbot__msg--user { justify-self: end; }
.chatbot__bubble {
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--color-border);
  background: var(--color-bg);
}
.chatbot__msg--user .chatbot__bubble { background: #ecfeff; border-color: #99f6e4; }
:root[data-theme="dark"] .chatbot__msg--user .chatbot__bubble { background: rgba(20,184,166,0.12); border-color: var(--color-border); }
.chatbot__meta { font-size: 12px; color: var(--color-muted); }
.chatbot__footer { border-top: 1px solid var(--color-border); padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--color-bg); }
.chatbot__form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.chatbot__input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--color-border); background: var(--color-bg); color: var(--color-dark); }
.chatbot__send { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--color-accent); background: var(--color-accent); color: #fff; cursor: pointer; }
.chatbot__typing { font-size: 12px; color: var(--color-muted); padding: 0 2px 8px; }

@media (max-width: 700px) {
  .chatbot-launcher { right: 12px; bottom: 12px; }
  /* Mobile: fullscreen chatbot */
  .chatbot {
    inset: 0;
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    right: auto;
    bottom: auto;
  }
  /* Hide launcher when chat is open on mobile to prevent overlap */
  .chatbot.is-open ~ .chatbot-launcher { display: none; }
}

/* #proces header layout + mini stats */
#proces .section__header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
#proces .header__text { max-width: 60ch; }
#proces .mini-stats { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-sm); }
#proces .mini-stats__item { text-align: center; min-width: 72px; }
#proces .mini-stats__num { font-size: 20px; line-height: 1; font-weight: 700; color: var(--color-primary); }
#proces .mini-stats__label { font-size: 12px; color: var(--color-muted); margin-top: 4px; }
#proces .mini-stats__sep { width: 1px; height: 28px; background: var(--color-border); }

/* Adjustments for the process stepper */
#proces [data-stepper] { max-width: 100%; margin: 0 auto; }
#proces .tabs__list { justify-content: center; gap: 18px; padding-bottom: 12px; margin-bottom: 16px; }
#proces .progress { max-width: none; margin: 12px auto 0; }
#proces .progress__bar { height: 16px; }
#proces .stepper__panels { margin-top: 20px; }
#proces .stepper__actions { justify-content: center; margin-top: 20px; }

/* Center step content cards (main + Livrabile) in #proces */
#proces .tabpanel.is-active {
  grid-template-columns: 1.5fr 1fr;
  justify-content: stretch;
  gap: 20px;
}
#proces .tabpanel.is-active > * { margin: 0; width: 100%; }
@media (max-width: 900px) { 
  #proces .tabpanel.is-active { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  #proces .section__header { align-items: flex-start; }
  #proces .mini-stats { padding: 8px 10px; }
  #proces .mini-stats__item { min-width: 64px; }
}
@media (max-width: 700px) {
  #proces .section__header { flex-direction: column; gap: 12px; }
  #proces .mini-stats { width: 100%; justify-content: space-between; }
}

/* Make Discovery & Scoping wider in step-1 */
#proces #step-1 .grid.grid--cols-2 { grid-template-columns: 2fr 1fr; align-items: stretch; }
@media (max-width: 900px) { #proces #step-1 .grid.grid--cols-2 { grid-template-columns: 1fr; } }

/* Make main cards wider for steps 2–5 as well */
#proces #step-2 .grid.grid--cols-2,
#proces #step-3 .grid.grid--cols-2,
#proces #step-4 .grid.grid--cols-2,
#proces #step-5 .grid.grid--cols-2 { grid-template-columns: 2fr 1fr; align-items: stretch; }
@media (max-width: 900px) {
  #proces #step-2 .grid.grid--cols-2,
  #proces #step-3 .grid.grid--cols-2,
  #proces #step-4 .grid.grid--cols-2,
  #proces #step-5 .grid.grid--cols-2 { grid-template-columns: 1fr; }
}

/* Ensure Proces section uses the same width as others */
#proces { --max-w: 1200px; }

/* Wider aside (Livrabile) while keeping main spacious via min column widths (fit in 1200px container) */
#proces #step-1 .grid.grid--cols-2 { grid-template-columns: minmax(700px, 2fr) minmax(420px, 1.4fr); }
#proces #step-2 .grid.grid--cols-2 { grid-template-columns: minmax(700px, 2fr) minmax(420px, 1.4fr); }
#proces #step-3 .grid.grid--cols-2 { grid-template-columns: minmax(700px, 2fr) minmax(420px, 1.4fr); }
#proces #step-4 .grid.grid--cols-2 { grid-template-columns: minmax(700px, 2fr) minmax(420px, 1.4fr); }
#proces #step-5 .grid.grid--cols-2 { grid-template-columns: minmax(700px, 2fr) minmax(420px, 1.4fr); }

@media (max-width: 1200px) {
  #proces #step-1 .grid.grid--cols-2,
  #proces #step-2 .grid.grid--cols-2,
  #proces #step-3 .grid.grid--cols-2,
  #proces #step-4 .grid.grid--cols-2,
  #proces #step-5 .grid.grid--cols-2 { grid-template-columns: 2fr 1.2fr; }
}
@media (max-width: 900px) {
  #proces { --max-w: 1200px; }
  #proces #step-1 .grid.grid--cols-2,
  #proces #step-2 .grid.grid--cols-2,
  #proces #step-3 .grid.grid--cols-2,
  #proces #step-4 .grid.grid--cols-2,
  #proces #step-5 .grid.grid--cols-2 { grid-template-columns: 1fr; }
}

/* Dark mode support */
:root, :root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0b1220; /* base */
  --color-bg-alt: #0f172a; /* panels */
  --color-dark: #e5e7eb; /* text */
  --color-muted: #94a3b8; /* secondary text */
  --color-border: #1f2a44; /* borders */
  --color-primary: #7dd3fc; /* brighter brand tone for headings on dark */
}
:root[data-theme="dark"] .hero {
  background: radial-gradient(1000px 600px at 80% -20%, rgba(20,184,166,0.15), transparent),
              linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  border-bottom-color: var(--color-border);
}
:root[data-theme="dark"] .hero--services {
  background: radial-gradient(900px 540px at 20% -20%, rgba(20,184,166,0.18), transparent),
              linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}
:root[data-theme="dark"] .hero h1 { color: var(--color-primary); text-shadow: 0 1px 0 rgba(0,0,0,0.35); }
:root[data-theme="dark"] .hero p { color: #cbd5e1; }

/* Smooth theme transitions */
body, .card, .service-card, .accordion__item, .accordion__button, .tabs__tab, .section--alt, .hero, .hero--services,
.input, .textarea, .select, .modal__dialog, .badge, .table th, .table td, .notice, .nav a, .header, .progress__bar {
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}

/* Header + nav under dark */
:root[data-theme="dark"] .header {
  background: rgba(11, 18, 32, 0.9);
  border-bottom-color: var(--color-border);
}
:root[data-theme="dark"] .nav a:hover,
:root[data-theme="dark"] .nav a.active {
  background: rgba(255,255,255,0.04);
}

/* Primary nav button tone for dark mode: keep accent fill, add subtle ring for contrast */
:root[data-theme="dark"] .header .nav .btn:not(.btn--ghost) {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff; /* ensure text/icon stays white over accent, override .nav a */
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 10px 18px rgba(20,184,166,0.28);
}
:root[data-theme="dark"] .header .nav .btn:not(.btn--ghost):hover {
  /* keep existing transform from .btn:hover */
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 14px 24px rgba(20,184,166,0.35);
}

/* Hero backgrounds in dark */
:root[data-theme="dark"] .hero {
  background: radial-gradient(1000px 600px at 80% -20%, rgba(20,184,166,0.15), transparent),
              linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  border-bottom-color: var(--color-border);
}
:root[data-theme="dark"] .hero--services {
  background: radial-gradient(900px 540px at 20% -20%, rgba(20,184,166,0.18), transparent),
              linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}

/* Cards and surfaces */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .service-card,
:root[data-theme="dark"] .accordion__item,
:root[data-theme="dark"] .hero__card {
  background: var(--color-bg);
  border-color: var(--color-border);
}

/* Tabs */
:root[data-theme="dark"] .tabs__list { border-bottom-color: var(--color-border); }
:root[data-theme="dark"] .tabs__tab:hover { background: rgba(255,255,255,0.04); color: var(--color-dark); }

/* Forms */
:root[data-theme="dark"] .input,
:root[data-theme="dark"] .textarea,
:root[data-theme="dark"] .select {
  background: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-dark);
}

/* Tables */
:root[data-theme="dark"] .table th { background: var(--color-bg-alt); }
:root[data-theme="dark"] .table th,
:root[data-theme="dark"] .table td { border-color: var(--color-border); }

/* Badges */
:root[data-theme="dark"] .badge { background: var(--color-bg); color: var(--color-dark); border-color: var(--color-border); }

/* Notice */
:root[data-theme="dark"] .notice { background: rgba(20,184,166,0.1); }
:root[data-theme="dark"] .notice--info { background: rgba(59,130,246,0.12); border-left-color: #60a5fa; }
:root[data-theme="dark"] .notice--success { background: rgba(16,185,129,0.12); border-left-color: #34d399; }
:root[data-theme="dark"] .notice--warning { background: rgba(245,158,11,0.12); border-left-color: #f59e0b; }
:root[data-theme="dark"] .notice--danger { background: rgba(239,68,68,0.12); border-left-color: #ef4444; }
:root[data-theme="dark"] .notice--tip { background: rgba(34,197,94,0.12); border-left-color: #22c55e; }

/* Timeline */
:root[data-theme="dark"] .timeline::before { background: var(--color-border); }
:root[data-theme="dark"] .timeline__item::before { background: var(--color-bg); }

/* Modal */
:root[data-theme="dark"] .modal__overlay { background: rgba(2, 6, 23, 0.65); }
:root[data-theme="dark"] .modal__dialog { background: var(--color-bg); border-color: var(--color-border); }
:root[data-theme="dark"] .modal__header { background: var(--color-bg-alt); border-bottom-color: var(--color-border); }

/* Footer keeps brand palette, but improve links contrast on dark */
:root[data-theme="dark"] .footer a { color: #99f6e4; }

/* Theme toggle control */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-dark);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--color-bg-alt); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }

/* Mobile parity for header controls */
@media (max-width: 900px) {
  .theme-toggle { width: 40px; height: 40px; }
}

/* Button improvements for mobile responsiveness */
@media (max-width: 600px) {
  .container {
    padding: 0 1rem;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    min-height: 44px; /* Touch target size */
    white-space: normal;
    word-break: break-word;
    line-height: 1.3;
  }
  
  .btn--large {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
  }
  
  /* Long button text handling */
  .btn--long-text {
    max-width: 280px;
    white-space: normal;
    text-align: center;
    padding: 0.875rem 1rem;
  }
  
  /* Navigation specific improvements */
  .header__nav .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    margin: 0.25rem;
  }
  
  /* Grid improvements for mobile */
  .grid--2-cols,
  .grid--3-cols,
  .grid--4-cols {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Form improvements */
  .form__group {
    margin-bottom: 1.5rem;
  }
  
  .form__input,
  .form__textarea,
  .form__select {
    padding: 0.875rem;
    font-size: 1rem; /* Prevent zoom on iOS */
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .btn {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    min-width: auto;
  }
  
  .btn--long-text {
    max-width: 240px;
    padding: 0.75rem 0.875rem;
  }
  
  /* Header improvements for very small screens */
  .header__nav .btn {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
  }
  
  /* Ensure proper spacing */
  section {
    padding: 2rem 0;
  }
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 300; /* above chatbot */
  display: flex;
  justify-content: center;
  padding: 0 12px;
  pointer-events: none; /* inner handles events */
  transition: opacity 200ms ease, transform 200ms ease;
}
.cookie-banner__inner {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 12px;
  pointer-events: all;
}
.cookie-banner__text { color: var(--color-dark); font-size: 14px; }
.cookie-banner__actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.cookie-banner--hide { opacity: 0; transform: translateY(10px); }

@media (max-width: 700px) {
  .cookie-banner { bottom: 12px; padding: 0 8px; }
  .cookie-banner__inner { grid-template-columns: 1fr; gap: 12px; }
}

:root[data-theme="dark"] .cookie-banner__inner {
  background: var(--color-bg);
  border-color: var(--color-border);
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
}