:root {
    --sea: #0a6e8a;
    --sea-light: #1a8fab;
    --sand: #f5ede0;
    --sand-dark: #e8d9c5;
    --coral: #d4614a;
    --white: #fdfaf6;
    --ink: #1a1a2e;
    --ink-soft: #3d3d5c;
    --success: #2e7d60;
    --radius: 4px;
  }

  .vmt-portal-wrap,
  .vmt-portal-wrap *,
  .vmt-portal-wrap *::before,
  .vmt-portal-wrap *::after {
    box-sizing: border-box;
  }

  .vmt-portal-wrap {
    font-family: 'DM Sans', sans-serif;
    background: var(--white);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: clip;
    overflow-y: visible;
  }

  /* Compensa barra admin WordPress quando l'utente è loggato */
  body.admin-bar .vmt-portal-wrap .portal-header {
    top: var(--wp-admin--admin-bar--height, 32px);
  }

  /* ── HEADER ─────────────────────────────────── */
  .vmt-portal-wrap .portal-header {
    background: var(--ink);
    color: var(--white);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    min-height: 72px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--sea);
  }

  .vmt-portal-wrap .logo {
    font-family: 'Cormorant Garamond', serif;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    line-height: 1.05;
    gap: 1px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .vmt-portal-wrap .logo-main {
    font-size: clamp(1.25rem, 4vw, 1.6rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  .vmt-portal-wrap .logo-care {
    font-size: clamp(1.15rem, 3.6vw, 1.45rem);
    font-weight: 300;
    font-style: italic;
    color: var(--sea-light);
    letter-spacing: 0.04em;
  }

  .vmt-portal-wrap .header-badge {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sand-dark);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 6px 10px;
    border-radius: 20px;
    line-height: 1.35;
    text-align: center;
    flex: 0 1 42%;
    max-width: 200px;
  }

  /* ── HERO BAND ──────────────────────────────── */
  .hero-band {
    background: linear-gradient(135deg, #0a6e8a 0%, #0d4f6b 55%, #1a8fab 100%);
    color: var(--white);
    padding: 56px 40px 48px;
    position: relative;
    overflow: hidden;
    min-height: 420px;
  }

  .hero-band::before {
    content: '';
    position: absolute;
    right: -80px; top: -80px;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
  }

  .hero-band::after {
    content: '';
    position: absolute;
    right: 80px; bottom: -120px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
  }

  .hero-inner { max-width: 760px; position: relative; z-index: 1; }

  .hero-eyebrow {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: 12px;
  }

  .hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    line-height: 1.15;
    margin-bottom: 16px;
  }

  .hero-title em { font-style: italic; color: #7ecfdf; }

  .hero-sub {
    font-size: 0.95rem;
    font-weight: 300;
    color: rgba(255,255,255,0.75);
    line-height: 1.7;
    max-width: 540px;
  }

  /* ── SERVICE ICONS BAR ─────────────────────── */
  .services-bar {
    background: var(--sand);
    border-bottom: 1px solid var(--sand-dark);
    padding: 20px 40px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .services-bar::-webkit-scrollbar { display: none; }

  .svc-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--ink-soft);
    background: var(--white);
    border: 1px solid var(--sand-dark);
    border-radius: 20px;
    padding: 6px 14px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .2s;
  }

  .svc-chip:hover { border-color: var(--sea); color: var(--sea); }
  .svc-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sea); }

  /* ── MAIN LAYOUT ──────────────────────────── */
  .main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 56px 40px 80px;
  }

  /* ── PROGRESS STEPS ───────────────────────── */
  .steps {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 48px;
  }

  .step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #aaa;
    flex: 1;
  }

  .step.active { color: var(--sea); }
  .step.done { color: var(--success); }

  .step-num {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
    background: #e8e8e8;
    color: #999;
    flex-shrink: 0;
    transition: all .3s;
  }

  .step.active .step-num { background: var(--sea); color: #fff; }
  .step.done .step-num { background: var(--success); color: #fff; }

  .step-line {
    flex: 1;
    height: 1px;
    background: #e0e0e0;
    margin: 0 10px;
  }

  /* ── FORM CARD ──────────────────────────── */
  .form-card {
    background: #fff;
    border: 1px solid #e8e2d9;
    border-radius: 12px;
    padding: 48px 64px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
  }

  .section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 6px;
  }

  .section-sub {
    font-size: 0.83rem;
    color: #888;
    margin-bottom: 32px;
    line-height: 1.6;
  }

  .divider {
    width: 40px; height: 2px;
    background: var(--sea);
    margin: 12px 0 28px;
  }

  /* ── FORM ELEMENTS ──────────────────────── */
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
  }

  .form-row.full { grid-template-columns: 1fr; }
  .form-row.triple { grid-template-columns: 1fr 1fr 1fr; }

  .field { display: flex; flex-direction: column; gap: 7px; }

  label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }

  label .req { color: var(--coral); margin-left: 2px; }

  input, select, textarea {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.93rem;
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid #d8d0c5;
    border-radius: var(--radius);
    padding: 12px 16px;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    width: 100%;
  }

  input:focus, select:focus, textarea:focus {
    border-color: var(--sea);
    box-shadow: 0 0 0 3px rgba(10,110,138,0.1);
  }

  input::placeholder, textarea::placeholder { color: #bbb; }

  textarea { resize: vertical; min-height: 110px; }

  select { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
  }

  /* ── SERVICE TYPE CARDS ─────────────────── */
  .service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .svc-card {
    border: 2px solid #e0d8cc;
    border-radius: 10px;
    padding: 18px 14px;
    cursor: pointer;
    text-align: center;
    transition: all .2s;
    background: var(--white);
    position: relative;
  }

  .svc-card:hover { border-color: var(--sea-light); background: #f0f8fb; }

  .svc-card.selected {
    border-color: var(--sea);
    background: #e8f6fa;
  }

  .svc-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px; right: 10px;
    font-size: 0.7rem;
    color: var(--sea);
    font-weight: 700;
  }

  .svc-icon { font-size: 1.8rem; margin-bottom: 8px; display: block; }

  .svc-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--ink-soft);
    line-height: 1.4;
  }

  .svc-card.selected .svc-label { color: var(--sea); }

  /* ── PRIORITY SELECTOR ──────────────────── */
  .priority-row {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
  }

  .prio-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0d8cc;
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all .2s;
    background: var(--white);
  }

  .prio-btn:hover { border-color: #aaa; }
  .prio-btn.sel-bassa { border-color: var(--success); background: #eaf5f0; color: var(--success); }
  .prio-btn.sel-media { border-color: #e09a1a; background: #fdf6e3; color: #9a6c00; }
  .prio-btn.sel-alta  { border-color: var(--coral); background: #fdf0ed; color: var(--coral); }

  .prio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
  .dot-bassa { background: var(--success); }
  .dot-media { background: #e09a1a; }
  .dot-alta  { background: var(--coral); }

  /* ── FILE UPLOAD ────────────────────────── */
  .upload-area {
    border: 2px dashed #d0c8bc;
    border-radius: 8px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: var(--white);
    margin-bottom: 24px;
  }

  .upload-area:hover { border-color: var(--sea-light); background: #f0f8fb; }
  .upload-icon { font-size: 2rem; margin-bottom: 8px; opacity: 0.5; }
  .upload-text { font-size: 0.85rem; color: #888; line-height: 1.6; }
  .upload-text strong { color: var(--sea); cursor: pointer; }
  #fileInput { display: none; }

  /* ── CONSENT ──────────────────────────── */
  .consent-box {
    background: var(--sand);
    border: 1px solid var(--sand-dark);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 28px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }

  .consent-box input[type="checkbox"] {
    width: 18px; height: 18px;
    flex-shrink: 0;
    cursor: pointer;
    margin-top: 2px;
    accent-color: var(--sea);
  }

  .consent-text { font-size: 0.82rem; color: #666; line-height: 1.65; }
  .consent-text a { color: var(--sea); text-decoration: none; }

  /* ── SUBMIT BUTTON ──────────────────────── */
  .btn-submit {
    width: 100%;
    padding: 17px;
    background: var(--sea);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all .2s;
    position: relative;
    overflow: hidden;
  }

  .btn-submit:hover { background: var(--sea-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(10,110,138,0.3); }
  .btn-submit:active { transform: translateY(0); }
  .btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

  /* ── SUCCESS SCREEN ──────────────────────── */
  #successScreen {
    display: none;
    text-align: center;
    padding: 60px 40px;
  }

  .success-icon {
    width: 80px; height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    margin: 0 auto 28px;
    animation: pop .4s cubic-bezier(.34,1.56,.64,1);
  }

  @keyframes pop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
  }

  .success-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 12px;
  }

  .success-sub { font-size: 0.92rem; color: #666; line-height: 1.7; max-width: 460px; margin: 0 auto 32px; }

  .ticket-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--ink);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    margin-bottom: 32px;
  }

  .ticket-badge span { color: var(--sea-light); font-weight: 600; font-size: 1rem; }

  .btn-new {
    padding: 13px 30px;
    border: 2px solid var(--sea);
    color: var(--sea);
    background: transparent;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
  }

  .btn-new:hover { background: var(--sea); color: #fff; }

  /* ── SIDEBAR INFO ──────────────────────── */
  .layout-split {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
  }

  .info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .info-card {
    background: #fff;
    border: 1px solid #e8e2d9;
    border-radius: 10px;
    padding: 22px;
    font-size: 0.85rem;
  }

  .info-card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--sea);
  }

  .info-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    color: #666;
    line-height: 1.5;
  }

  .info-item .ico { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }

  .emer-card {
    background: #fff8f6;
    border: 1px solid #f5c4b8;
    border-radius: 10px;
    padding: 20px;
    font-size: 0.85rem;
  }

  .emer-card .emer-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 8px;
  }

  .emer-num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink);
    display: block;
    margin-bottom: 4px;
  }

  .emer-sub { color: #888; font-size: 0.8rem; }

  /* ── FORM SECTION DIVIDER ─────────────── */
  .fsep {
    margin: 32px 0;
    border: none;
    border-top: 1px solid #ede7de;
  }

  .field-hint {
    font-size: 0.75rem;
    color: #aaa;
    margin-top: 4px;
  }

  /* ── RESPONSIVE ─────────────────────── */
  @media (max-width: 768px) {
    .vmt-portal-wrap .portal-header {
      padding: 12px 14px;
      min-height: 0;
      align-items: flex-start;
    }

    .vmt-portal-wrap .logo-main,
    .vmt-portal-wrap .logo-care {
      white-space: normal;
    }

    .vmt-portal-wrap .header-badge {
      font-size: 0.58rem;
      letter-spacing: 0.06em;
      padding: 5px 8px;
      max-width: 46%;
      margin-top: 2px;
    }

    .hero-band { padding: 32px 16px 28px; min-height: 0; }
    .hero-title { font-size: clamp(1.65rem, 7vw, 2.2rem); }
    .hero-sub { font-size: 0.9rem; }
    .services-bar { padding: 12px 14px; gap: 6px; }
    .main-wrap { padding: 24px 14px 48px; }
    .layout-split { grid-template-columns: 1fr; }
    .info-sidebar { display: none; }
    .form-card { padding: 18px 14px; border-radius: 8px; }
    .service-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .form-row, .form-row.triple { grid-template-columns: 1fr; gap: 12px; }
    .steps { gap: 0; margin-bottom: 28px; }
    .step .step-label { display: none; }
    .btn-submit, .btn-new { font-size: 1rem; padding: 14px; border-radius: 8px; }
    input, select, textarea { font-size: 16px; padding: 12px; }
    .svc-card { padding: 14px 10px; }
    .priority-row { flex-direction: column; gap: 8px; }
    .upload-area { padding: 16px; font-size: 0.95rem; }
    label { font-size: 0.92rem; }
    .section-title { font-size: 1.15rem; }
    .success-title { font-size: 1.3rem; }
    .success-icon { width: 60px; height: 60px; font-size: 1.3rem; }
    .ticket-badge { font-size: 0.95rem; padding: 10px; }
  }

  /* Ottimizzazione input per mobile */
  input[type="tel"] { font-size: 1.1rem; }
  input[type="date"], input[type="datetime-local"] { font-size: 1.1rem; }
  input, select, textarea { touch-action: manipulation; }
  button, .btn-submit, .btn-new, .svc-card, .prio-btn { touch-action: manipulation; }

  /* ── ANIMATIONS ─────────────────────── */
  .form-card { animation: fadeUp .5s ease both; }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .hero-inner { animation: fadeUp .6s ease both; }

  .error-msg {
    font-size: 0.75rem;
    color: var(--coral);
    margin-top: 4px;
    display: none;
  }

  input.invalid, select.invalid, textarea.invalid {
    border-color: var(--coral);
  }

/* Notice shortcode */
.vmt-notice {
  padding: 16px 20px;
  border-radius: 8px;
  margin: 16px 0;
  font-family: 'DM Sans', sans-serif;
}
.vmt-notice-error {
  background: #fdf0ed;
  border: 1px solid var(--coral);
  color: #8b2e1f;
}
.vmt-notice a { color: var(--sea); font-weight: 600; }