/* Added on top of the page design: theme switch and contact dialog. */

/* ===== Theme switch ===== */
.theme-btn{position:relative;width:40px;height:40px;display:inline-grid;place-items:center;flex:none;padding:0;border:0;border-radius:12px;background:transparent;color:var(--ink-2);cursor:pointer;transition:color .2s,background-color .2s}
.theme-btn:hover{color:var(--ink);background:rgba(10,18,32,.045)}
.theme-btn .ico{grid-area:1/1;width:20px;height:20px;transition:transform .45s cubic-bezier(.2,.8,.2,1),opacity .25s}
.theme-btn .t-sun{opacity:0;transform:rotate(-70deg) scale(.6)}
html[data-theme="dark"] .theme-btn .t-sun{opacity:1;transform:none}
html[data-theme="dark"] .theme-btn .t-moon{opacity:0;transform:rotate(70deg) scale(.6)}
html:not(.js) .theme-btn{display:none}
.nav.on-dark .theme-btn{color:#CBD5E1}
.nav.on-dark .theme-btn:hover{color:#fff;background:rgba(255,255,255,.07)}
::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}
::view-transition-old(root){z-index:1}
::view-transition-new(root){z-index:2}

/* Shown only in the dark theme (see dark.css). */
.grain,.nav-prog,.hero-spot{display:none}

/* Sign in is hidden for now: remove this rule to show it again. */
[data-signin]{display:none !important}

/* ===== Back to top ===== */
.to-top{position:fixed;right:24px;bottom:calc(24px + env(safe-area-inset-bottom));z-index:90;width:48px;height:48px;display:grid;place-items:center;border-radius:16px;background:var(--bg);color:var(--ink-2);box-shadow:var(--sh-2),0 0 0 1px var(--line);text-decoration:none;opacity:0;visibility:hidden;transform:translateY(12px);transition:opacity .3s,transform .45s cubic-bezier(.2,.8,.2,1),visibility .3s,color .2s,box-shadow .2s}
.to-top.show{opacity:1;visibility:visible;transform:none}
.to-top:hover{color:var(--ink);box-shadow:var(--sh-2),0 0 0 1px var(--line-2)}
.to-top:focus-visible{outline:0;box-shadow:var(--sh-2),0 0 0 1.5px var(--cyan),0 0 0 5px rgba(6,182,212,.18)}
.to-top .ico{width:20px;height:20px;transform:rotate(-90deg);transition:transform .45s cubic-bezier(.2,.8,.2,1)}
.to-top:hover .ico{transform:rotate(-90deg) translateX(2px)}
html:not(.js) .to-top{display:none}
html[data-theme="dark"] .to-top{background:var(--bg-soft);color:var(--ink-2)}
html[data-theme="dark"] .to-top:hover{color:var(--cyan-2);box-shadow:var(--sh-2),0 0 0 1px rgba(34,211,238,.35),0 0 24px -6px rgba(34,211,238,.45)}
/* Room under the last footer line, so the button never covers it when the page is narrower than the button's margin. */
@media (max-width:1440px){
  .foot{padding-bottom:96px}
}
@media (max-width:760px){
  .to-top{right:16px;bottom:calc(16px + env(safe-area-inset-bottom));width:44px;height:44px;border-radius:14px}
  .foot{padding-bottom:80px}
}

/* ===== Contact dialog ===== */
html.dlg-open{overflow:hidden;scrollbar-gutter:stable}
.cdlg{width:min(620px,calc(100vw - 32px));max-width:none;max-height:none;margin:auto;padding:0;border:0;background:transparent;color:var(--ink);overflow:visible}
.cdlg::backdrop{background:rgba(10,18,32,.5);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.cdlg[open]{animation:cdlg-in .4s cubic-bezier(.2,.8,.2,1)}
.cdlg[open]::backdrop{animation:cdlg-fade .3s ease}
@keyframes cdlg-in{from{opacity:0;transform:translateY(16px) scale(.98)}}
@keyframes cdlg-fade{from{opacity:0}}
.cdlg-in{position:relative;max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain;padding:44px;border-radius:30px;background:var(--bg);box-shadow:var(--sh-3),0 0 0 1px var(--line)}
.cdlg-x{position:absolute;top:18px;right:18px;width:40px;height:40px;display:grid;place-items:center;padding:0;border:0;border-radius:12px;background:transparent;color:var(--ink-3);cursor:pointer;transition:color .2s,background-color .2s}
.cdlg-x:hover{color:var(--ink);background:rgba(10,18,32,.045)}
.cdlg-x .ico{width:20px;height:20px}
.cdlg h2{font-size:clamp(28px,2.6vw,36px);font-weight:800;letter-spacing:-.035em;line-height:1.1;margin:16px 0 0}
.cdlg-sub{font-size:16px;line-height:1.6;color:var(--ink-3);margin:12px 0 0}
.cf-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 14px;margin-top:26px}
.cf-w{grid-column:1/-1}
.cf{min-width:0}
.cf label{display:flex;align-items:baseline;justify-content:space-between;gap:10px;font-size:14px;font-weight:700;color:var(--ink-2);margin-bottom:7px}
.cf label small{font-size:12.5px;font-weight:600;color:var(--ink-4)}
.cf input,.cf textarea{display:block;width:100%;padding:12px 14px;border:0;border-radius:14px;background:var(--bg-soft);box-shadow:inset 0 0 0 1px var(--line-2);color:var(--ink);font-family:var(--f-ui);font-size:16px;line-height:1.5;transition:box-shadow .2s,background-color .2s}
.cf textarea{min-height:128px;resize:vertical}
.cf input:hover,.cf textarea:hover{box-shadow:inset 0 0 0 1px var(--ink-4)}
.cf input:focus,.cf textarea:focus{outline:0;background:var(--bg);box-shadow:inset 0 0 0 1.5px var(--cyan),0 0 0 4px rgba(6,182,212,.16)}
.cf [aria-invalid="true"]{box-shadow:inset 0 0 0 1.5px var(--u-bad)}
.cf-msg{margin:6px 0 0;font-size:13.5px;font-weight:600;color:var(--u-bad)}
.cf-msg:empty{display:none}
.cf-hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.cf-err{margin:16px 0 0;padding:11px 14px;border-radius:12px;background:var(--u-bad-soft);color:var(--u-bad);font-size:14.5px;font-weight:600}
.cf-err[hidden]{display:none}
.cf-foot{display:flex;align-items:center;flex-wrap:wrap;gap:12px 18px;margin-top:22px}
.cf-foot .btn[disabled]{opacity:.7;cursor:default;transform:none}
.cf-note{flex:1 1 200px;margin:0;font-size:13px;line-height:1.5;color:var(--ink-3)}
.cf-note a{color:inherit;text-underline-offset:2px}
.cf-ok{padding:18px 0 6px;text-align:center}
.cf-ok[hidden]{display:none}
.cf-tick{width:56px;height:56px;display:grid;place-items:center;margin:0 auto;border-radius:50%;background:var(--u-ok-soft);color:var(--u-ok)}
.cf-tick .ico{width:26px;height:26px;stroke-width:2.2}
.cf-ok p{font-size:16px;line-height:1.6;color:var(--ink-3);margin:12px 0 24px}
#contact-form[hidden]{display:none}
@media (max-width:760px){
  .cdlg-in{padding:28px 22px;border-radius:24px}
  .cf-grid{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:reduce){
  .cdlg[open],.cdlg[open]::backdrop{animation:none}
  .theme-btn .ico{transition:none}
  .to-top,.to-top .ico{transition:none}
}

/* ===== Not found page ===== */
.nf{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;padding:48px var(--gut);text-align:center}
html.is-loading .nf{opacity:1}
.nf .brand img{height:26px}
.nf .h2{margin-top:36px}
.nf .lead{margin:16px 0 30px}

/* ===== Step numbers removed (Luca, 8/11): lists without the 01/02/03 column ===== */
.ai-points li{grid-template-columns:1fr}
