:root{
  --bg:#0b0f14; --card:#10161d; --muted:#8aa0b2; --text:#e5f1ff;
  --pri:#5dd6a0; --pri-600:#27c07f; --b:#1a2430; --b2:#131a22; --outline:#2a3a4d;--outline-main:#009688;
  --flash:#2ae9a5;
}
*{box-sizing:border-box}
html,body{height:100%}
html{scroll-behavior:smooth}
@font-face {
  font-family: "Poppins";
  src: url("/assets/fonts/poppins/Poppins-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("/assets/fonts/poppins/Poppins-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("/assets/fonts/poppins/Poppins-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("/assets/fonts/poppins/Poppins-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html, body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body{margin:0;font:16px/1.5;background:var(--bg);color:var(--text)}
.container{max-width:1050px;margin:0 auto;padding:0}

.site-header{position:sticky;top:0;backdrop-filter:blur(10px);background:rgb(13 21 31);border-bottom:1px solid #0f1620;z-index:10}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  padding:14px 0;
  position:relative;
  column-gap:16px;
}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;letter-spacing:.3px;color:var(--text);text-decoration:none}
.brand img{height:28px}
.nav{
  display:flex;
  flex-direction:row;
  align-items:center;
  gap:18px;
}
.nav a{
  color:var(--muted);
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  font-size:14px;
  padding:4px 0;
}
.nav a.active,
.nav-item.has-mega.is-open > a{
  color:#34c587;
  font-weight:600;
}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}

.nav-toggle{
  display:none;
  margin-left:auto;
  background:transparent;
  border:0;
  padding:6px;
  cursor:pointer;
  border-radius:8px;
}
.nav-toggle:focus-visible{
  outline:2px solid var(--outline-main);
  outline-offset:2px;
}
.nav-toggle-bar{
  display:block;
  width:20px;
  height:2px;
  background:var(--text);
  border-radius:999px;
  margin:3px 0;
  transition:transform .18s ease,opacity .18s ease;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(1){
  transform:translateY(5px) rotate(45deg);
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(2){
  opacity:0;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(3){
  transform:translateY(-5px) rotate(-45deg);
}

/* ===== Mega menu "Convertire file" ===== */

.nav {
 
}

.nav-item {
  
  display: inline-block;
}

.nav-item.has-mega > a {
  position: relative;
  display:inline-flex;
  align-items:center;
  gap:4px;
}
.nav-text{
  white-space:nowrap;
  font-weight: bold;
    font-size: 16px;
}
.nav-item.has-mega #navIconArrow,
.nav-item.has-mega #navIconClose{
  width:16px;
  height:16px;
  margin-left:6px;
  margin-right:0;
}

/* Contenitore mega-menu (base) */
.mega-menu {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0;
  background: #ffffff;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 16px 20px;
  min-width: 520px;
  z-index: 50;
  display: none;
}

/* Apertura controllata via classe JS */
.nav-item.has-mega.is-open .mega-menu {
  display: block;
  background: linear-gradient(#ffffff, #eceef4);
}

/* Layout colonne interne */
.mega-inner {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 24px;
}

.mega-col {
  min-width: 190px;
  width: -webkit-fill-available;
}

.mega-col h3 {
    font-size: 13px;
    text-transform: uppercase;
    color: #009688;
    margin: 0 0 10px;
    line-height: 1em;
    font-weight: 700;
    background: #607d8b12;
    padding: .55rem;
}

.mega-col a {
    display: block;
    font-size: 0.8rem;
    color: #16202f;
    text-decoration: none;
    margin: 0;
    padding: 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    background: #151f2d00;
    transition: all .25s ease-out;
    cursor: pointer;
}

.mega-col a:hover {
    background: #d7dee1ab;
    border-radius: 4px;
    transition: all .2s linear;
}

/* Footer link "tutti i formati" */
.mega-footer {
  border-top: 1px solid #e4e8ec;
  margin-top: 10px;
  padding-top: 8px;
  text-align: right;
}

.mega-footer a {
    font-size: 0.9rem;
    color: #009688;
    text-decoration: none;
    font-weight: bold;
}

.mega-footer a:hover {
  text-decoration: underline;
}



/* ===== Adattamenti responsive (mobile/tablet) ===== */

@media (max-width: 768px) {
  a#brandLink {
    white-space: nowrap;
}
  .site-header .header-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  section {
    padding: 40px 1rem !important;
}

  .nav {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
  }

  .nav > p {
    width: 100%;
    margin-bottom: 0.25rem;
  }

  .nav-item,
  .nav > a {
    display: inline-flex;
    align-items: center;
  }

  /* Il mega diventa blocco sotto la voce */
  .mega-menu {
    position: static;
    margin-top: 0.25rem;
    box-shadow: none;
    border-radius: 6px;
    padding: 10px 12px;
    min-width: 0;
    border: 1px solid #eee;
  }

  .mega-inner {
    flex-direction: column;
    gap: 10px;
  }

  .mega-col {
    min-width: 100%;
  }

  .mega-footer {
    text-align: left;
    margin-top: 8px;
  }
}

.page-wrap{position:relative}
.page-wrap canvas{width:100%;height:auto;background:#0f1822;border:1px solid #2a3a4d;border-radius:8px;display:block}
  

.hero{padding:40px 0;background:radial-gradient(1200px 600px at 20% -10%, #192536, transparent)}
.hero h1{font-size:40px;margin:0 0 8px}
.sub{color:var(--muted);margin:0 0 24px}
#dropzone, #dz{border:1px dashed var(--outline-main);}
.dropzone {
    border-radius: 16px;
    text-align: center;
    outline: none;
    background: #0f1822f0;
    height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.dropzone:focus{box-shadow:0 0 0 3px rgba(93,214,160,.25)}
.dropzone input[type=file]{display:none}
button#browse-btn {
    width: 200px;
    margin: 0 auto;
    line-height: 25px;
    border-radius: 0;
    font-size: 15px;
    background: var(--outline-main);
    font-weight: 700;
    letter-spacing: .3px;
    color: #ffffff;
}
button#browse-btn:hover{border: 1px solid #5ad59e;color:#fff;}
.accepted-formats{
  margin-top:14px;background:#0f1822;border:1px solid var(--outline);
  border-radius:12px;padding:12px 14px;color:var(--text);font-size:14px;
}
.accepted-formats .fmt-row{opacity:.9; margin:4px 0}
a.btn.subtle.dl {
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    padding: 7px 16px;
    background: #03A9F4;
}
/* sticky actions sopra l'anteprima */
.sticky-actions {
  position: sticky;
  top: 0;
  z-index: 1200;
  display: block;
  margin: 12px 0;
  pointer-events: auto;
  background: #0a0f13f0;
  padding: 10px;
}

.sticky-actions-inner {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
}

/* manteniamo le classi .btn coerenti con il layout esistente — ma aggiungiamo una piccola ombra per separare dalla preview */
.sticky-actions .btn {
  box-shadow: 0 6px 18px rgba(2,6,12,0.45);
  padding: 10px 16px;
  border-radius: 12px;
  
}

/* comportamento responsive: su mobile la barra diventa scrollable orizzontalmente */
@media (max-width: 720px) {
  .mega-inner{flex-wrap:wrap}
  .sticky-actions-inner { overflow-x: auto; padding-bottom: 6px; }
  .sticky-actions .btn { white-space: nowrap; flex: 0 0 auto; }
}
div#mapping-hint {
    display: block;
    font-size: 11px;
    width: 50%;
}
#mapping-hint b{color: #2cc382;}
.btn{display:inline-block;padding:10px 16px;border-radius:12px;border:1px solid var(--outline);background:var(--b);color:var(--text);cursor:pointer}
.btn.primary{background:linear-gradient(90deg,var(--pri),var(--pri-600));border:0;color:#00170e;font-weight:700}
.btn.subtle{background:var(--b2);}
.btn[disabled]{opacity:.6;cursor:not-allowed}

.select{
  appearance:auto;background:var(--b2);border:1px solid var(--outline);
  color:var(--text);padding:10px 12px;border-radius:12px;pointer-events:auto;
}

.hints{margin-top:10px;color:var(--muted);display:flex;gap:12px;justify-content:center;flex-wrap:wrap}

.badge{padding:2px 8px;border-radius:999px;border:1px solid var(--outline);background:#0f1822;color:var(--muted);font-size:12px}

.jobs{padding:28px 0 56px}
.jobs-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:12px}
.jobs-actions{display:flex;align-items:center;gap:10px}
.queue{display:grid;gap:12px}
.card{background:var(--card);border:1px solid #15202d;border-radius:16px;padding:14px}
.cardHead{display:flex;align-items:center;justify-content:space-between;gap:10px}
.name{font-weight:600;/*overflow:hidden;text-overflow:ellipsis;white-space:nowrap;*/max-width:52vw;overflow:hidden;}
.meta{font-size:13px;color:var(--muted);max-width:270px;}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

/* Select formato + qualità nelle card */
.actions .select{min-width:110px}
.actions .qual{min-width:140px}

.progress{height:8px;background:#0f1822;border-radius:999px;overflow:hidden;margin-top:8px}
.progress>i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--pri),var(--pri-600))}
.status{font-size:12px;color:var(--muted)}
.row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px;}

/* Evidenziazione nuovi elementi della coda */
@keyframes flashBorder {
  0% { box-shadow: 0 0 0 0 rgba(42,233,165,0.0), inset 0 0 0 0 rgba(42,233,165,0.0); border-color:#15202d; }
  20% { box-shadow: 0 0 0 6px rgba(42,233,165,0.15); border-color: var(--flash); }
  60% { box-shadow: 0 0 0 0 rgba(42,233,165,0.0); border-color: var(--flash); }
  100%{ box-shadow: 0 0 0 0 rgba(42,233,165,0.0); border-color:#15202d; }
}
.flash{animation: flashBorder 1.4s ease-out 1;}

.toast{position:fixed;right:16px;bottom:16px;background:var(--card);border:1px solid #15202d;border-radius:12px;padding:12px 14px;box-shadow:0 8px 30px rgba(0,0,0,.3);display:none}
.toast.show{display:block}
.toast.ok{border-color:#1f3;}
.toast.err{border-color:#f53}

.site-footer{border-top:1px solid #101a27;padding:24px 0;color:var(--muted)}
.links a{color:var(--muted);margin-left:14px;text-decoration:none}
.info{color:var(--muted)}
.faq details{background:#0f1822;border:1px solid var(--outline);border-radius:12px;padding:12px 14px;margin:8px 0}
.faq details[open]{background:#0f1c28}

@media (max-width:720px){
  .hero h1{font-size:30px;line-height: 1.3em;}
  .jobs-actions{flex-wrap:wrap}
}

   .overlay{position:absolute;inset:0;pointer-events:none;z-index:2}
    .overlay.active{pointer-events:auto;cursor:crosshair}
    .marker{
      position:absolute;transform:translate(-50%,-100%);
      background:#0d1f14;border:1px solid #2ae9a5;border-radius:8px;padding:4px 6px;
      font-size:12px;color:#c9ffe8;pointer-events:auto;cursor:grab;user-select:none;white-space:nowrap;z-index:3
    }
    .marker.dragging{opacity:.85;cursor:grabbing}
    .marker .x{margin-left:6px;cursor:pointer;color:#f88}
    .seo-section {padding:40px 0;background:#f9fafb;color:#222;}
    .seo-section h2 {font-size:1.8em;margin-bottom:12px;color:#0f1822;}
    .seo-section p {max-width:780px;line-height:1.6;margin-bottom:16px;}
    .seo-section ul {max-width:780px;margin-left:20px;}
    .seo-section li {margin-bottom:8px;}
    .sticky-actions {position: sticky; top: 0; z-index: 1500; display: none; margin-bottom: 10px; pointer-events: auto;}
    .sticky-actions-inner {display:flex; gap:12px; align-items:center; background:transparent; padding:2px 4px;}
    .sticky-actions .sticky-btn{padding:10px 16px; border-radius:12px; box-shadow: 0 6px 18px rgba(2,6,12,0.35); cursor:pointer; user-select:none; background:#1f2933; color:#fff; border:1px solid rgba(255,255,255,0.04);}
    .sticky-actions .sticky-btn.primary{ background: #64d489; color: #071b10; border:none; }
    .sticky-actions .sticky-btn.subtle{ background:transparent; color:#fff; border:1px solid rgba(255,255,255,0.06); }
    .sticky-actions .sticky-btn.pressed{ transform: translateY(-2px); transition: transform .12s ease; }
    .sticky-actions .sticky-btn.active{ box-shadow: 0 8px 24px rgba(100,212,137,0.15); }
    @media (max-width:720px){ .sticky-actions { display:block; } .sticky-actions-inner { overflow-x:auto; } .sticky-actions .sticky-btn { flex:0 0 auto; white-space:nowrap; } }
  
.ai-controls{display:inline-flex;align-items:center;gap:.5rem}


/* Header "File in coda" */
.jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.jobs-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Card in coda */
.job-card {
  padding: 1rem 1.25rem;
}

/* Riga principale della card */
.job-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* Blocco icona + nome file */
.job-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 260px;
}

/* Blocco con le select (Output / Qualità / Formattazione AI) */
/* Layout header della coda (titolo + strumenti a destra) */
.jobs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;          /* per non rompere su mobile */
}

.jobs-head h2 {
  margin: 0;
}

/* Barra azioni (badge + select + bottoni) allineata in riga */
.jobs-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Evita margini strani dentro la toolbar */
.jobs-actions > * {
  margin: 0;
}

/* Select un minimo larghe, come prima */
.jobs-actions .select {
  min-width: 180px;
}
.job-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  flex: 1 1 260px;
}

/* Label sopra le select */
.job-setting label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

/* Select visivamente allineate ai bottoni */
.job-setting select,
.job-settings .select {
  min-height: 36px;
}

/* Pulsanti Converti / Rimuovi allineati a destra */
.job-actions {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 0.5rem;
}
.jobs-actions .badge {
  font-size: 0.9rem;
}

.jobs-actions .btn.primary {
  /* leggero spazio prima del gruppo bottoni */
  margin-left: 0.5rem;
}
.job-progress{display: block;width: 100%;}
.job-progress .progress-bar{height: 10px;background: #cccccc1a;}
.job-progress .progress-bar .progress-fill {background: #2ec383;height: 10px;}
.job-progress .progress-bar .progress-label, .progress-label{font-size: 14px;line-height: 32px;color: #fff;}
.icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  display: inline-block;
}

.nav .icon {
  margin-right: 6px;
}

.btn .icon {
  margin-right: 6px;
}

.mega-menu-fullwidth {
  left:50%;
  transform:translateX(-50%);
  width:min(1050px, calc(100vw - 32px));
}

@media (max-width: 768px) {
  .nav-toggle{
    display:none;
  }

  .site-header .header-inner{
    flex-wrap:nowrap;
    align-items:center;
    padding: 14px 1rem;
  }

  .nav{
    margin-left:0;
    flex:0 0 auto;
    gap:12px;
    
  }

  .mega-menu.is-fullscreen{
    position: fixed;
        left: 0;
        inset: 0;
        z-index: 999;
        background: #0b0f14;
        padding: 72px 16px 24px;
        overflow-y: auto;
        transform: translateX(0);
        width: 100%;
        border-radius: 0;
        top: 60px;
        height: 100vh;
        padding-top: 20px;
  }

  .mega-menu.is-fullscreen .mega-inner{
    flex-direction:column;
    gap:10px;
  }

  .mega-menu.is-fullscreen .mega-col{
    min-width:100%;
    border-right:0;
    
  }

  .mega-menu.is-fullscreen .mega-col:last-child{
    border-bottom:0;
    margin-bottom:0;
    padding-bottom:0;
  }

  .mega-menu.is-fullscreen .mega-footer{
    text-align:left;
    margin-top:16px;
  }

  body.mega-open{
    overflow:hidden;
  }
}