/* ============================================================
   KaraDom AI — portale servizi (ai.karadom.it)
   Palette KaraDom: navy #060c1c / #0b1226, ciano #1ec8ff,
   blu elettrico #2b6cff, viola #8a3cff. Testi bianchi.
   ============================================================ */
:root {
  --bg: #060c1c;
  --bg-2: #0b1226;
  --bg-3: #111a33;
  --line: rgba(120, 160, 255, .16);
  --line-2: rgba(120, 160, 255, .28);
  --text: #ffffff;
  --text-2: #c9d4f0;
  --text-3: #8f9cc0;
  --cyan: #1ec8ff;
  --blue: #2b6cff;
  --violet: #8a3cff;
  --ok: #2fe39a;
  --warn: #ffc857;
  --err: #ff6b81;
  --grad: linear-gradient(120deg, var(--cyan) 0%, var(--blue) 48%, var(--violet) 100%);
  --grad-soft: linear-gradient(120deg, rgba(30, 200, 255, .16), rgba(138, 60, 255, .16));
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: "Outfit", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --maxw: 1180px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--blue); color: #fff; padding: .6em 1em; border-radius: 10px; }
.skip:focus { left: 12px; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .7em 1.35em; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; font-weight: 700; font-size: 1rem;
  color: #fff; text-decoration: none !important; transition: transform .15s, box-shadow .2s, background .2s, opacity .2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); box-shadow: 0 8px 26px rgba(43, 108, 255, .45); }
.btn-primary:hover { box-shadow: 0 12px 34px rgba(43, 108, 255, .6); }
.btn-ghost { background: rgba(255, 255, 255, .04); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .09); }
.btn-paypal { background: linear-gradient(135deg, #003087, #009cde); }
.btn-bank { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.btn-lg { min-height: 56px; font-size: 1.12rem; padding: .85em 1.8em; }
.btn-block { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Barra in alto ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 12, 28, .86);
  backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; text-decoration: none !important; }
.brand img { height: 42px; width: auto; }
.brand-ai {
  font-weight: 800; font-size: .95rem; padding: .1em .55em; border-radius: 8px;
  background: var(--grad); color: #fff; letter-spacing: .04em;
}
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { color: var(--text-2); padding: .5em .8em; border-radius: 10px; font-weight: 600; font-size: .98rem; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }
.auth { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.auth .btn { min-height: 40px; padding: .5em 1.05em; font-size: .95rem; }
.user-box { display: none; align-items: center; gap: 10px; }
.is-logged .user-box { display: flex; }
.is-logged .guest-box { display: none; }
.guest-box { display: flex; gap: 8px; }
.user-name { font-weight: 700; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip {
  display: inline-flex; align-items: center; gap: .35em; font-size: .82rem; font-weight: 700;
  padding: .3em .7em; border-radius: 999px; background: var(--grad-soft); border: 1px solid var(--line-2); white-space: nowrap;
}
.chip b { color: var(--cyan); font-weight: 800; }
.chip.zero b { color: var(--warn); }
.user-link { color: var(--text-2); font-weight: 600; font-size: .95rem; }
.menu-btn { display: none; background: none; border: 1px solid var(--line-2); color: #fff; border-radius: 10px; width: 44px; height: 44px; cursor: pointer; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { display: block; width: 20px; height: 2px; background: #fff; margin: 0 auto; position: relative; content: ""; }
.menu-btn span::before { position: absolute; top: -6px; }
.menu-btn span::after { position: absolute; top: 6px; }
.nav .m-only { display: none; }
.nav .m-user { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 64px; overflow: hidden; }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; z-index: -1; pointer-events: none;
}
.hero::before { width: 560px; height: 560px; left: -160px; top: -200px; background: #1474d6; }
.hero::after { width: 520px; height: 520px; right: -160px; bottom: -260px; background: #6a2fd6; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em; font-weight: 700; font-size: .85rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--cyan); background: rgba(30, 200, 255, .09); border: 1px solid rgba(30, 200, 255, .3);
  padding: .35em .9em; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); }
.hero .lead { font-size: clamp(1.08rem, 1.6vw, 1.28rem); color: var(--text-2); max-width: 40em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--text-2); font-size: .98rem; }
.hero-points li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: .45em; }
.hero-art { position: relative; display: grid; place-items: center; }
.hero-art img { width: min(460px, 100%); filter: drop-shadow(0 20px 60px rgba(30, 140, 255, .45)); animation: float 7s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px); } }
.eq { display: flex; gap: 6px; align-items: flex-end; height: 56px; margin-top: 10px; }
.eq i { display: block; width: 7px; border-radius: 4px; background: var(--grad); animation: eq 1.2s ease-in-out infinite; }
.eq i:nth-child(odd) { animation-duration: .9s; }
.eq i:nth-child(3n) { animation-duration: 1.4s; }
@keyframes eq { 0%, 100% { height: 18%; } 50% { height: 100%; } }

/* ---------- Sezioni ---------- */
section { padding: 72px 0; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { text-align: center; max-width: 760px; margin: 0 auto 44px; }
.sec-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.sec-head p { color: var(--text-2); font-size: 1.08rem; }
.tag { display: inline-block; font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin-bottom: 10px; }

.cards-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card {
  background: linear-gradient(180deg, rgba(17, 26, 51, .9), rgba(11, 18, 38, .9));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.svc-card { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.svc-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); }
.svc-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line-2); margin-bottom: 16px; }
.svc-icon svg { width: 30px; height: 30px; }
.svc-card h3 { font-size: 1.5rem; }
.svc-card p { color: var(--text-2); }
.svc-card .btn { margin-top: auto; align-self: flex-start; }

/* dettaglio servizio */
.svc { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.svc + .svc { margin-top: 80px; }
.svc h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.svc .intro { color: var(--text-2); font-size: 1.08rem; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 22px 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding-left: 52px; min-height: 40px; color: var(--text-2); }
.steps li strong { color: #fff; display: block; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 800; background: var(--grad); color: #fff;
}
.formats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.formats li { font-size: .85rem; font-weight: 700; padding: .35em .8em; border-radius: 8px; background: rgba(43, 108, 255, .12); border: 1px solid rgba(43, 108, 255, .35); }
.svc h3 { font-size: 1.1rem; margin-top: 22px; }
.svc-cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.svc-note { font-size: .92rem; color: var(--text-3); margin: 10px 0 0; min-height: 1.4em; }
.svc-note.ok { color: var(--ok); }
.svc-note.warn { color: var(--warn); }

.ba { display: grid; gap: 14px; }
.ba figure { margin: 0; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.ba figcaption { font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ba figcaption small { color: var(--text-3); font-weight: 500; }
.wave { height: 64px; border-radius: 10px; background:
  repeating-linear-gradient(90deg, rgba(30, 200, 255, .75) 0 3px, transparent 3px 7px);
  -webkit-mask: radial-gradient(ellipse 60% 100% at 50% 50%, #000 40%, transparent 100%);
  mask: radial-gradient(ellipse 60% 100% at 50% 50%, #000 40%, transparent 100%);
}
.wave.v { background: repeating-linear-gradient(90deg, rgba(138, 60, 255, .8) 0 3px, transparent 3px 7px); }
.wave.thin { height: 34px; opacity: .8; }
.lyrics { font-size: 1.15rem; font-weight: 700; margin-top: 12px; letter-spacing: .01em; }
.lyrics .on { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lyrics .off { color: var(--text-3); }
.stems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stems span { font-size: .85rem; font-weight: 700; padding: .5em .4em; text-align: center; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.demo-note { font-size: .8rem; color: var(--text-3); text-align: right; margin: 0; }

/* come funziona */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: h; }
.how .card { text-align: left; }
.how .num { font-size: 2.6rem; font-weight: 800; line-height: 1; margin-bottom: 12px; }
.how p { color: var(--text-2); margin: 0; }

/* ---------- Abbonamenti ---------- */
.plan-group + .plan-group { margin-top: 56px; }
.plan-group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 18px; }
.plan-group-head h3 { font-size: 1.6rem; margin: 0; }
.plan-group-head p { margin: 0; color: var(--text-2); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.plans.two { grid-template-columns: repeat(2, minmax(0, 380px)); }
.plan { position: relative; display: flex; flex-direction: column; padding: 26px; }
.plan.best { border-color: rgba(30, 200, 255, .55); box-shadow: 0 0 0 1px rgba(30, 200, 255, .35), var(--shadow); }
.plan .ribbon { position: absolute; top: -12px; right: 18px; font-size: .78rem; font-weight: 800; padding: .3em .8em; border-radius: 999px; background: var(--grad); }
.plan h4 { font-size: 1.15rem; margin-bottom: 4px; }
.plan .desc { color: var(--text-3); font-size: .95rem; margin-bottom: 14px; }
.price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.price .cur { font-size: 1.3rem; font-weight: 700; color: var(--text-2); }
.price .amt { font-size: 2.8rem; font-weight: 800; line-height: 1; }
.price .per { color: var(--text-2); font-weight: 600; }
.plan .qty { font-weight: 700; color: var(--cyan); margin-bottom: 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; color: var(--text-2); font-size: .96rem; }
.plan ul li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: .5em; }
.plan .btn { margin-top: auto; }
.plan .active-badge { display: none; margin: 0 0 12px; padding: .45em .8em; border-radius: 10px; font-size: .88rem; font-weight: 700; background: rgba(47, 227, 154, .1); border: 1px solid rgba(47, 227, 154, .4); color: var(--ok); }
.plan.is-active .active-badge { display: block; }
.plans-foot { text-align: center; color: var(--text-3); font-size: .92rem; margin-top: 28px; }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0 20px; }
.faq summary { cursor: pointer; list-style: none; padding: 18px 30px 18px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--cyan); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details > div { color: var(--text-2); padding-bottom: 18px; }

/* ---------- Contatti / Footer ---------- */
.contact { text-align: center; }
.contact .card { max-width: 760px; margin: 0 auto; background: var(--grad-soft), var(--bg-2); }
.footer { border-top: 1px solid var(--line); padding: 44px 0 28px; background: #040915; color: var(--text-3); font-size: .95rem; }
.footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer h2 { font-size: 1rem; color: #fff; margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer a { color: var(--text-2); }
.footer .logo-f { height: 40px; width: auto; margin-bottom: 12px; }
.footer .copy { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.crumbs { font-size: .85rem; color: var(--text-3); padding-top: 14px; }
.crumbs ol { list-style: none; display: flex; gap: 6px; padding: 0; margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: 6px; }
.crumbs a { color: var(--text-3); }

/* ---------- Modali ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  padding: 16px; background: rgba(2, 5, 14, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal.open { display: flex; }
.modal-box {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: linear-gradient(180deg, #121c38, #0b1226); border: 1px solid var(--line-2); border-radius: 20px;
  padding: 30px 26px 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  animation: pop .18s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-box h2 { font-size: 1.5rem; margin-bottom: 4px; }
.modal-box .sub { color: var(--text-2); margin-bottom: 18px; font-size: .98rem; }
.x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, .06); color: #fff; font-size: 1.4rem; cursor: pointer; }
.x:hover { background: rgba(255, 255, 255, .12); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: .9rem; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field input {
  width: 100%; min-height: 46px; padding: .6em .85em; border-radius: 12px; border: 1px solid var(--line-2);
  background: rgba(3, 8, 20, .7); color: #fff; font: inherit; font-size: 1rem;
}
.field input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(30, 200, 255, .22); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.captcha { display: flex; justify-content: center; margin: 14px 0; min-height: 78px; }
.captcha.trusted { display: none; }
.msg { display: none; margin: 10px 0; padding: .7em .9em; border-radius: 12px; font-size: .95rem; }
.msg.show { display: block; }
.msg.error { background: rgba(255, 107, 129, .1); border: 1px solid rgba(255, 107, 129, .45); color: #ffc2cc; }
.msg.success { background: rgba(47, 227, 154, .1); border: 1px solid rgba(47, 227, 154, .45); color: #b9ffe0; }
.msg.info { background: rgba(30, 200, 255, .08); border: 1px solid rgba(30, 200, 255, .4); color: #c8f1ff; }
.alt { text-align: center; color: var(--text-3); font-size: .95rem; margin-top: 14px; }
.alt button.linklike, .linklike { background: none; border: 0; color: var(--cyan); cursor: pointer; padding: 0; font-weight: 600; }
.alt button.linklike:hover { text-decoration: underline; }
.summary { background: rgba(3, 8, 20, .6); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.summary .r { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.summary .r span:first-child { color: var(--text-3); }
.summary .r span:last-child { font-weight: 700; text-align: right; word-break: break-word; }
.summary .tot span:last-child { color: var(--ok); font-size: 1.1rem; }
.pay-buttons { display: grid; gap: 10px; }
.small { font-size: .85rem; color: var(--text-3); }
.copy-btn { margin-left: 6px; font-size: .8rem; padding: .15em .6em; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--cyan); cursor: pointer; }

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(140%); z-index: 120;
  background: #13204a; border: 1px solid var(--line-2); padding: .85em 1.2em; border-radius: 14px; box-shadow: var(--shadow);
  max-width: calc(100% - 32px); transition: transform .3s ease, opacity .3s, visibility .3s;
  opacity: 0; visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }

/* ---------- Responsive ---------- */
@media (max-width: 1060px) {
  .nav { display: none; }
  .menu-btn { display: block; order: 3; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: #070e22; border-bottom: 1px solid var(--line); padding: 10px 16px 16px; margin: 0;
  }
  .nav.open a, .nav.open button { padding: .8em .6em; font-size: 1.05rem; }
  .nav.open .m-only { display: block; }
  .nav.open .m-user { display: none; }
  .is-logged .nav.open .m-guest { display: none; }
  .is-logged .nav.open .m-user { display: block; }
  .nav button.m-only { background: none; border: 0; color: var(--text-2); text-align: left; font-weight: 600; cursor: pointer; border-radius: 10px; }
}
@media (max-width: 900px) {
  .hero .wrap, .svc, .cards-2 { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art img { width: min(300px, 80%); }
  .plans, .plans.two, .how { grid-template-columns: 1fr; }
  .plans { max-width: 460px; margin: 0 auto; }
  .plans.two { max-width: 460px; margin: 0 auto; grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .user-link.acc, .user-name { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  section { padding: 56px 0; }
  .hero { padding: 36px 0 48px; }
  .brand img { height: 32px; }
  .brand-ai { font-size: .8rem; }
  .topbar .wrap { gap: 10px; }
  .auth { gap: 6px; }
  .auth .btn { min-height: 38px; padding: .4em .8em; font-size: .88rem; }
  .guest-box .btn-ghost { display: none; }
  .chip { font-size: .74rem; padding: .25em .55em; }
  .user-box .user-link.out { display: none; }
  .hero-cta .btn { width: 100%; }
  .card { padding: 22px; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .footer .cols { grid-template-columns: 1fr; }
  .stems { grid-template-columns: repeat(2, 1fr); }
  .svc-cta .btn { width: 100%; }
  .modal-box { padding: 26px 18px 20px; }
  .captcha { transform: scale(.92); transform-origin: center top; }
}
