:root {
      --bg: #F5F3EE;
      --white: #FFFFFF;
      --ink: #1A1A1A;
      --ink-soft: #5A5A5A;
      --accent: #E8500A;
      --accent-light: #FFF0EA;
      --accent-hover: #C73D00;
      --green: #1A9E5C;
      --green-light: #E6F7EE;
      --red: #D63030;
      --red-light: #FDECEC;
      --yellow: #E8A30A;
      --yellow-light: #FEF8E6;
      --border: #E0DDD5;
      --shadow: 0 2px 16px rgba(0,0,0,0.07);
      --radius: 14px;
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: 'DM Sans', sans-serif;
      background: var(--bg);
      color: var(--ink);
      min-height: 100vh;
    }

    /* HEADER */
    header {
      background: var(--white);
      border-bottom: 1px solid var(--border);
      padding: 18px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .headBtn{
        color: inherit;          /* usa il colore del testo normale */
        text-decoration: none;   /* toglie la sottolineatura */
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 3px;
      font-family: 'Sora', sans-serif;
      font-weight: 800;
      font-size: 1.3rem;
      color: var(--accent);
      letter-spacing: -0.5px;
    }
    .logo span { color: var(--ink); }
    .badge-free {
      background: var(--accent-light);
      color: var(--accent);
      font-size: 0.72rem;
      font-weight: 600;
      padding: 4px 10px;
      border-radius: 20px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    /*LANG SWITCHER*/
    .lang-dropdown { position: relative; display: inline-block; }

.lang-trigger {
  display: flex; align-items: center; gap: 7px;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 999px; padding: 6px 12px 6px 10px;
  cursor: pointer; font-family: 'Sora', sans-serif;
  font-size: 0.8rem; font-weight: 700; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lang-trigger:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,80,10,0.1);
}
.lt-arrow { transition: transform 0.2s; }
.lang-dropdown.open .lt-arrow { transform: rotate(180deg); }

.lang-menu {
  display: none; position: absolute;
  top: calc(100% + 8px); right: 0;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 190px; z-index: 999; overflow: hidden;
  animation: dropIn 0.18s ease;
}
.lang-dropdown.open .lang-menu { display: block; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lang-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; text-decoration: none;
  color: var(--ink); font-size: 0.9rem; font-weight: 500;
  transition: background 0.12s;
  border-top: 1px solid var(--border);
}
.lang-option:hover  { background: var(--accent-light); }
.lang-option.active { background: var(--accent-light); color: var(--accent); font-weight: 700; }
.lang-option.active .lo-tag   { background: var(--accent); color: white; }
.lang-option.active .lo-check { opacity: 1; }
.lo-check { opacity: 0; color: var(--accent); }

    /* HERO */
    .hero {
      text-align: center;
      padding: 52px 24px 36px;
      max-width: 640px;
      margin: 0 auto;
    }
    .hero h1 {
      font-family: 'Sora', sans-serif;
      font-size: clamp(1.7rem, 5vw, 2.6rem);
      font-weight: 800;
      line-height: 1.2;
      color: var(--ink);
      margin-bottom: 14px;
    }
    .hero h1 em {
      font-style: normal;
      color: var(--accent);
    }
    .hero p {
      color: var(--ink-soft);
      font-size: 1.05rem;
      line-height: 1.6;
    }

    /* MAIN CARD */
    .main-card {
      background: var(--white);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      max-width: 680px;
      margin: 0 auto 32px;
      padding: 32px 28px;
      border: 1px solid var(--border);
    }

    /* STEP LABELS */
    .step-label {
      font-family: 'Sora', sans-serif;
      font-size: 0.78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--accent);
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .step-num {
      background: var(--accent);
      color: white;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      font-size: 0.65rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    /* DROP ZONE */
    .drop-zone {
      border: 2.5px dashed var(--border);
      border-radius: var(--radius);
      padding: 40px 20px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      background: var(--bg);
      position: relative;
      margin-bottom: 28px;
    }
    .drop-zone:hover, .drop-zone.drag-over {
      border-color: var(--accent);
      background: var(--accent-light);
    }
    .drop-zone input {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
      width: 100%;
      height: 100%;
    }
    .drop-icon {
      font-size: 2.8rem;
      margin-bottom: 10px;
      display: block;
    }
    .drop-zone h2 {
      font-family: 'Sora', sans-serif;
      font-size: 1.1rem;
      font-weight: 700;
      margin-bottom: 6px;
    }
    .drop-zone p {
      color: var(--ink-soft);
      font-size: 0.9rem;
    }
    .file-info-bar {
      display: none;
      align-items: center;
      gap: 12px;
      background: var(--accent-light);
      border: 1px solid #FACCB0;
      border-radius: 10px;
      padding: 12px 16px;
      margin-bottom: 28px;
    }
    .file-info-bar.visible { display: flex; }
    .file-info-bar .fi-icon { font-size: 1.5rem; }
    .file-info-bar .fi-name { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
    .file-info-bar .fi-size { font-size: 0.85rem; color: var(--ink-soft); }
    .fi-remove {
      margin-left: auto;
      cursor: pointer;
      color: var(--ink-soft);
      font-size: 1.2rem;
      line-height: 1;
      background: none;
      border: none;
      padding: 4px;
    }

    /* EMAIL SERVICE SELECTOR */
    .section-divider {
      height: 1px;
      background: var(--border);
      margin-bottom: 24px;
    }
    .email-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 10px;
      margin-bottom: 28px;
    }
    .email-radio { display: none; }
    .email-label {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      padding: 14px 10px 12px;
      border-radius: 12px;
      border: 2px solid var(--border);
      cursor: pointer;
      background: var(--white);
      transition: all 0.18s;
      text-align: center;
    }
    .email-label:hover {
      border-color: var(--accent);
      background: var(--accent-light);
    }
    .email-radio:checked + .email-label {
      border-color: var(--accent);
      background: var(--accent-light);
      box-shadow: 0 0 0 3px rgba(232,80,10,0.12);
    }
    .email-icon { font-size: 1.6rem; line-height: 1; }
    .email-name {
      font-family: 'Sora', sans-serif;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--ink);
    }
    .email-limit {
      font-size: 0.7rem;
      color: var(--ink-soft);
      font-weight: 500;
    }

    /* COMPRESS BUTTON */
    .btn-compress {
      width: 100%;
      background: var(--accent);
      color: white;
      font-family: 'Sora', sans-serif;
      font-size: 1.05rem;
      font-weight: 700;
      padding: 16px;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      transition: background 0.18s, transform 0.1s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      letter-spacing: -0.2px;
    }
    .btn-compress:hover:not(:disabled) {
      background: var(--accent-hover);
      transform: translateY(-1px);
    }
    .btn-compress:disabled {
      opacity: 0.45;
      cursor: not-allowed;
      transform: none;
    }

    /* PROGRESS */
    .progress-wrap {
      display: none;
      margin-top: 20px;
    }
    .progress-wrap.visible { display: block; }
    .progress-bar-bg {
      background: var(--border);
      border-radius: 999px;
      height: 8px;
      overflow: hidden;
      margin-bottom: 8px;
    }
    .progress-bar-fill {
      height: 100%;
      background: var(--accent);
      border-radius: 999px;
      width: 0%;
      transition: width 0.3s ease;
    }
    .progress-text {
      font-size: 0.85rem;
      color: var(--ink-soft);
      text-align: center;
    }

    /* RESULT PANEL */
    .result-panel {
      display: none;
      margin-top: 28px;
    }
    .result-panel.visible { display: block; }

    .result-stats {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 12px;
      margin-bottom: 20px;
    }
    .stat-box {
      background: var(--bg);
      border-radius: 12px;
      padding: 16px 12px;
      text-align: center;
      border: 1px solid var(--border);
    }
    .stat-label {
      font-size: 0.72rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--ink-soft);
      font-weight: 600;
      margin-bottom: 6px;
    }
    .stat-value {
      font-family: 'Sora', sans-serif;
      font-size: 1.25rem;
      font-weight: 800;
      color: var(--ink);
    }
    .stat-value.green { color: var(--green); }
    .stat-value.accent { color: var(--accent); }

    /* EMAIL COMPATIBILITY BANNER */
    .compat-banner {
      border-radius: 12px;
      padding: 16px 18px;
      display: flex;
      align-items: flex-start;
      gap: 14px;
      margin-bottom: 20px;
      font-size: 0.92rem;
      line-height: 1.5;
    }
    .compat-banner.ok {
      background: var(--green-light);
      border: 1.5px solid #8FD9B6;
      color: #14733F;
    }
    .compat-banner.warn {
      background: var(--yellow-light);
      border: 1.5px solid #F5CC6A;
      color: #8A5C00;
    }
    .compat-banner.error {
      background: var(--red-light);
      border: 1.5px solid #EFAAAA;
      color: var(--red);
    }
    .compat-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 1px; }
    .compat-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 0.97rem; margin-bottom: 3px; }

    /* LIMIT BAR */
    .limit-bar-wrap {
      background: var(--bg);
      border-radius: 12px;
      padding: 16px;
      border: 1px solid var(--border);
      margin-bottom: 20px;
    }
    .limit-bar-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      font-size: 0.85rem;
    }
    .limit-bar-label { font-weight: 600; color: var(--ink); }
    .limit-bar-pct { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1rem; }
    .limit-bar-bg {
      background: var(--border);
      border-radius: 999px;
      height: 14px;
      overflow: hidden;
      position: relative;
    }
    .limit-bar-fill {
      height: 100%;
      border-radius: 999px;
      transition: width 0.4s ease;
    }
    .limit-bar-marker {
      position: absolute;
      top: -4px;
      bottom: -4px;
      width: 3px;
      background: var(--ink);
      border-radius: 2px;
      opacity: 0.3;
    }
    .limit-bar-caption {
      display: flex;
      justify-content: space-between;
      margin-top: 6px;
      font-size: 0.75rem;
      color: var(--ink-soft);
    }

    /* DOWNLOAD BUTTON */
    .btn-download {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      width: 100%;
      background: var(--green);
      color: white;
      font-family: 'Sora', sans-serif;
      font-size: 1rem;
      font-weight: 700;
      padding: 15px;
      border: none;
      border-radius: 12px;
      cursor: pointer;
      transition: background 0.18s, transform 0.1s;
      text-decoration: none;
    }
    .btn-download:hover { background: #148048; transform: translateY(-1px); }

    /* FAQ / INFO */
    .info-section {
      max-width: 680px;
      margin: 0 auto 48px;
      padding: 0 24px;
    }
    .info-section h2 {
      font-family: 'Sora', sans-serif;
      font-size: 1.2rem;
      font-weight: 700;
      margin-bottom: 16px;
      color: var(--ink);
    }
    .faq-item {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 16px 18px;
      margin-bottom: 10px;
    }
    .faq-q {
      font-weight: 600;
      font-size: 0.95rem;
      margin-bottom: 6px;
      color: var(--ink);
    }
    .faq-a {
      font-size: 0.88rem;
      color: var(--ink-soft);
      line-height: 1.6;
    }

    /* FOOTER */
    footer {
      text-align: center;
      padding: 24px;
      font-size: 0.8rem;
      color: var(--ink-soft);
      border-top: 1px solid var(--border);
    }

    @media (max-width: 520px) {
      .main-card { padding: 24px 16px; margin: 0 12px 24px; }
      .result-stats { grid-template-columns: 1fr 1fr; }
      .result-stats .stat-box:last-child { grid-column: 1 / -1; }
      .email-grid { grid-template-columns: repeat(2, 1fr); }
    }