/* Apple-like system font stack */
@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@400;600;700&display=swap');

#permutatore .permutatore-form {
  --accent: #0071e3;
  --accent-600: #0a84ff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --bg: #fff;
  --surface: #f5f5f7;
  --border: #d2d2d7;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0,0,0,.08);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  max-width: 960px;
  margin: 32px auto;
  padding: 28px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow)
}

#permutatore .perm-title {
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 .75rem
}

#permutatore .perm-hint {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1.2rem;
  background: #f7f9fc;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  font-size: .95rem
}

#permutatore .perm-progress {
  height: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 22px
}

#permutatore .perm-progress-bar {
  height: 10px;
  background: var(--accent);
  transition: width .28s ease
}

@keyframes permFadeUp {
  0% {
    opacity: 0;
    transform: translateY(8px)
  }

  100% {
    opacity: 1;
    transform: translateY(0)
  }
}

#permutatore .perm-step {
  animation: permFadeUp .28s ease both;
  margin-bottom: 2.5rem
}

#permutatore .perm-step[hidden] {
  display: none
}

#permutatore .perm-fieldset {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 18px;
  padding: 24px 26px;
  margin: 28px 0;
  box-shadow: 0 16px 40px rgba(0,0,0,.06);
  transition: box-shadow .25s ease, transform .1s ease
}

#permutatore .perm-fieldset:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(16, 24, 40, .08)
}

#permutatore .perm-fieldset>legend {
  padding: 0 .7rem;
  font-weight: 700;
  color: #101828;
  font-size: 1.05rem;
  margin-bottom: .6rem
}

#permutatore .perm-choice {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: .85rem 0;
  padding: .8rem 1rem;
  border: 1px solid #e3e8ef;
  border-radius: 12px;
  background: #f9fafb;
  cursor: pointer;
  transition: all .25s ease;
  position: relative
}

#permutatore .perm-choice:hover {
  background: #f2f2f7;
  border-color: #e5e5ea;
  box-shadow: 0 6px 20px rgba(0,0,0,.06)
}

#permutatore .perm-choice:has(input:checked) {
  background: #f5f5f7;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, .20);
  transform: translateY(-1px)
}

#permutatore .perm-choice span {
  font-size: 1rem;
  color: #1d2327;
  line-height: 1.4;
  font-weight: 500;
  flex: 1
}

#permutatore .perm-choice input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  display: inline-block;
  position: relative;
  transition: all .25s ease;
  flex-shrink: 0
}

#permutatore .perm-choice input[type="radio"]:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 115, 190, .12)
}

#permutatore .perm-choice input[type="radio"]:checked {
  border-color: var(--accent);
  background: radial-gradient(circle at center, var(--accent) 55%, transparent 56%);
  box-shadow: 0 0 0 4px rgba(30, 115, 190, .15);
  animation: permRadioPop .25s ease
}

#permutatore .perm-choice input[type="checkbox"] {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  position: relative;
  transition: all .25s ease;
  flex-shrink: 0
}

#permutatore .perm-choice input[type="checkbox"]:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 115, 190, .12)
}

#permutatore .perm-choice input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 115, 190, .15);
  animation: permRadioPop .25s ease
}

#permutatore .perm-choice input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 7px;
  height: 13px;
  border: 2px solid #fff;
  border-left: none;
  border-top: none;
  transform: rotate(45deg)
}

@keyframes permRadioPop {
  0% {
    transform: scale(.8);
    opacity: .6
  }

  100% {
    transform: scale(1);
    opacity: 1
  }
}

#permutatore .perm-upload {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px dashed #e3e8ef
}

#permutatore .perm-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600
}

#permutatore .custom-select-wrapper {
  position: relative;
  max-width: 700px;
  margin: 8px 0 16px
}

#permutatore .custom-select-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1.5px solid var(--border);
  background: #fff;
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0,0,0,.05);
  font-size: 1rem;
  transition: border-color .2s ease, transform .06s ease
}

#permutatore .custom-select-toggle:hover {
  border-color: #d0e5ff;
  transform: translateY(-1px)
}

#permutatore .custom-select-arrow {
  opacity: .75
}

#permutatore .custom-select-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  z-index: 1000;
  max-height: 360px;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .12);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease
}

#permutatore .custom-select-toggle[aria-expanded="true"]+.custom-select-panel,
#permutatore .custom-select-panel:not([hidden]) {
  opacity: 1;
  transform: translateY(0)
}

#permutatore .custom-select-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border)
}

#permutatore .custom-select-search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .2s ease, box-shadow .2s ease
}

#permutatore .custom-select-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 115, 190, .15);
  outline: 0
}

#permutatore .custom-select-options {
  padding: 6px
}

#permutatore .custom-select-option {
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease
}

#permutatore .custom-select-option:hover {
  background: #f6f9ff
}

#permutatore .custom-select-option.selected {
  background: #eef6ff;
  border: 1px solid #d0e5ff
}

#permutatore .opt-inner {
  display: flex;
  align-items: center;
  gap: 12px
}

#permutatore .opt-thumb {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid var(--border)
}

#permutatore .opt-title {
  font-weight: 600
}

#permutatore .opt-sub {
  font-size: .86rem;
  color: var(--muted)
}

#permutatore .permutatore-form input[type="text"],
#permutatore .permutatore-form input[type="email"],
#permutatore .permutatore-form input[type="tel"],
#permutatore .permutatore-form input[type="file"] {
  display: block;
  width: 100%;
  max-width: 560px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, transform .06s ease;
  margin: .45rem 0
}

#permutatore .permutatore-form input[type="text"]:focus,
#permutatore .permutatore-form input[type="email"]:focus,
#permutatore .permutatore-form input[type="tel"]:focus,
#permutatore .permutatore-form input[type="file"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30, 115, 190, .15);
  outline: 0
}

#permutatore .perm-invalid {
  outline: 2px solid #d63638;
  outline-offset: 2px;
  border-radius: 10px
}

#permutatore .perm-fieldset-error {
  border-color: #f87171 !important;
  background: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
  animation: permutatore-shake 0.5s ease-in-out
}

@keyframes permutatore-shake {

  0%,
  100% {
    transform: translateX(0)
  }

  25% {
    transform: translateX(-2px)
  }

  75% {
    transform: translateX(2px)
  }
}

#permutatore .perm-nav {
  display: flex;
  gap: 12px;
  margin-top: 22px
}

#permutatore .perm-nav .perm-next,
#permutatore .perm-nav .perm-back,
#permutatore .perm-submit {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 13px 20px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  font-weight: 700;
  letter-spacing: .01em;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease
}

#permutatore .perm-nav .perm-back {
  background: #8e8e93
}

#permutatore .perm-nav .perm-next:hover,
#permutatore .perm-submit:hover {
  transform: translateY(-1px);
  background: var(--accent-600)
}

#permutatore .perm-nav .perm-next:focus,
#permutatore .perm-nav .perm-back:focus,
#permutatore .perm-submit:focus {
  outline: 0;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, .18), var(--shadow);
}

#permutatore .perm-nav .perm-back:hover {
  background: #6e6e73
}

#permutatore .perm-loading {
  margin-left: 8px;
  color: var(--muted)
}

#permutatore .permutatore-message {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow)
}

#permutatore .perm-success {
  background: #ecfdf3;
  border-color: #a7f3d0
}

#permutatore .perm-error {
  background: #fef2f2;
  border-color: #fecaca
}

@media (max-width:640px) {
  #permutatore .permutatore-form {
    padding: 18px
  }

  #permutatore .perm-title {
    font-size: 1.35rem
  }

  #permutatore .perm-nav {
    flex-direction: column
  }

  #permutatore .perm-nav button {
    width: 100%
  }
}

/* ===== Styling per la fase 10 - Dati di contatto ===== */
#permutatore .perm-step[data-step="10"] {
  background: linear-gradient(145deg, #f8fafc 0%, #ffffff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

#permutatore .perm-step[data-step="10"] .perm-title {
  text-align: center;
  margin-bottom: 28px;
  color: var(--accent);
  position: relative;
}

.perm-quote-thumb{
  margin-bottom: 32px;
}

.perm-quote-price-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid #1e73be;
  border-radius: 12px;
  padding: 2px 10px;
  background-color: #1e73be;
}

#permutatore .perm-step[data-step="10"] .perm-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, #6aa8ff 100%);
  margin: 8px auto 0;
  border-radius: 2px;
}

#permutatore .perm-step[data-step="10"] label {
  display: block;
  margin-bottom: 20px;
  font-weight: 600;
  color: var(--text);
}

#permutatore .perm-step[data-step="10"] label:has(input[type="checkbox"]) {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: #f0f7ff;
  border: 1px solid #d0e5ff;
  border-radius: 12px;
  margin-top: 24px;
  font-weight: 500;
  line-height: 1.5;
}

#permutatore .perm-step[data-step="10"] input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: #fff;
  position: relative;
  transition: all .25s ease;
  flex-shrink: 0;
  margin-top: 2px;
}

#permutatore .perm-step[data-step="10"] input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

#permutatore .perm-step[data-step="10"] input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: 2px solid #fff;
  border-left: none;
  border-top: none;
  transform: rotate(45deg);
}

#permutatore .perm-step[data-step="10"] input[type="text"],
#permutatore .perm-step[data-step="10"] input[type="email"],
#permutatore .perm-step[data-step="10"] input[type="tel"] {
  margin-top: 8px;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .04);
}

#permutatore .permutatore-wrap {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 24px;
  align-items: start
}

#permutatore .perm-sidebar {
  position: sticky;
  top: 90px
}

#permutatore .perm-quote-card {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px
}

#permutatore .perm-quote-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

#permutatore .perm-quote-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: .01em;
  color: #fff; 
}

#permutatore .perm-quote-sub {
  color: var(--muted);
  font-size: .92rem
}

@media (max-width:980px) {
  #permutatore .permutatore-wrap {
    grid-template-columns: 1fr;
    gap: 16px
  }

  #permutatore .perm-sidebar {
    position: static
  }
}





/* ===== v1.7.0 – Step 1 premium card + quote box polish ===== */
#permutatore .perm-step:first-of-type {
  --radius: 18px;
  --card-bg: #ffffff;
  --grad-1: #e9f1ff;
  --grad-2: #f7f9ff;
  --border: #e6e9ef;
  --shadow: 0 12px 30px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .06);
  background: linear-gradient(165deg, var(--grad-1) 0%, var(--grad-2) 100%);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  isolation: isolate;
}

#permutatore .perm-step:first-of-type::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, #0071e3 0%, #0a84ff 100%);
  opacity: .9;
}

#permutatore .perm-step:first-of-type .perm-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.9rem;
  margin: 10px 0 16px;
}

#permutatore .perm-step:first-of-type .perm-title::before {
  content: "1";
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #0071e3, #0a84ff);
  box-shadow: 0 6px 16px rgba(30, 115, 190, .25);
}

#permutatore .perm-step:first-of-type .custom-select-toggle {
  border-radius: 14px;
  background: #fff;
  border: 1.5px solid #dfe4ec;
  box-shadow: 0 10px 22px rgba(16, 24, 40, .06);
  padding: 16px 18px;
  font-size: 1.05rem;
  transition: box-shadow .25s ease, transform .06s ease, border-color .2s ease;
}

#permutatore .perm-step:first-of-type .custom-select-toggle:hover {
  border-color: #cfe0ff;
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(16, 24, 40, .10);
}

#permutatore .perm-step:first-of-type .custom-select-panel {
  border: 1px solid #e3e9f3;
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(16, 24, 40, .12);
}

#permutatore .perm-step:first-of-type .perm-nav {
  margin-top: 24px;
  justify-content: center;
}

#permutatore .perm-step:first-of-type .perm-nav .perm-back {
  background: #8b93a3;
}

#permutatore .perm-step:first-of-type .perm-nav .perm-next {
  min-width: 170px;
  font-size: 1.05rem;
  padding: 14px 22px;
  box-shadow: 0 10px 24px rgba(30, 115, 190, .25);
}

#permutatore .perm-step:first-of-type .perm-nav .perm-next:hover {
  transform: translateY(-1px);
}

#permutatore .perm-progress {
  border-radius: 999px;
  height: 8px;
  border: none;
  background: #eef2f7;
  margin: 4px 0 20px;
}

#permutatore .perm-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0071e3, #0a84ff);
}

/* quote card border/shadow neutral */
#permutatore .perm-quote-card {
  border: 1px solid #ddd !important;
  box-shadow: 0 8px 22px rgba(16, 24, 40, .08) !important;
  border-radius: 16px !important;
  background: #fff !important;
}

#permutatore .perm-quote-value[data-value] {
  transition: transform .15s ease, filter .15s ease;
}

#permutatore .perm-quote-value.flash {
  transform: scale(1.02);
  filter: saturate(115%);
}

@media (max-width: 980px) {
  #permutatore .perm-step:first-of-type {
    padding: 22px 18px;
  }

  #permutatore .perm-step:first-of-type .perm-title {
    font-size: 1.6rem;
  }
}


/* ===== v1.7.1 – Uniform card layout for ALL steps ===== */
#permutatore .perm-step {
  --radius: 18px;
  --grad-1: #e9f1ff;
  --grad-2: #f7f9ff;
  --border: #e6e9ef;
  --shadow: 0 12px 30px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .06);
  background: linear-gradient(165deg, var(--grad-1) 0%, var(--grad-2) 100%);
  border-radius: var(--radius);
  padding: 28px 26px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  isolation: isolate;
}

#permutatore .perm-step::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, #1e73be 0%, #6aa8ff 100%);
  opacity: .9;
}

/* Step title with round badge (number per step) */
#permutatore .perm-step .perm-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.75rem;
  margin: 10px 0 16px;
}

#permutatore .perm-step .perm-title::before {
  content: "";
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #1e73be, #4b88d9);
  box-shadow: 0 6px 16px rgba(30, 115, 190, .25);
}

/* Numbers 1..10 */
#permutatore .perm-step[data-step="1"] .perm-title::before {
  content: "1";
}

#permutatore .perm-step[data-step="2"] .perm-title::before {
  content: "2";
}

#permutatore .perm-step[data-step="3"] .perm-title::before {
  content: "3";
}

#permutatore .perm-step[data-step="4"] .perm-title::before {
  content: "4";
}

#permutatore .perm-step[data-step="5"] .perm-title::before {
  content: "5";
}

#permutatore .perm-step[data-step="6"] .perm-title::before {
  content: "6";
}

#permutatore .perm-step[data-step="7"] .perm-title::before {
  content: "7";
}

#permutatore .perm-step[data-step="8"] .perm-title::before {
  content: "8";
}

#permutatore .perm-step[data-step="9"] .perm-title::before {
  content: "9";
}

#permutatore .perm-step[data-step="10"] .perm-title::before {
  content: "10";
}

/* Centered nav in all steps */
#permutatore .perm-step .perm-nav {
  margin-top: 24px;
  justify-content: center;
}

@media (max-width: 980px) {
  #permutatore .perm-step {
    padding: 22px 18px;
  }

  #permutatore .perm-step .perm-title {
    font-size: 1.55rem;
  }
}


/* v1.7.2 - Show only the numbered circle, hide textual number if present */
#permutatore .perm-step .perm-title {
  counter-reset: none !important;
}

#permutatore .perm-step .perm-title::before {
  margin-right: 10px;
}

#permutatore .perm-step .perm-title strong {
  display: inline;
}

/* Remove the step number from textual title if it is written like '1.' or '2.' */
#permutatore .perm-step .perm-title {
  font-weight: 700;
}

#permutatore .perm-step .perm-title {
  counter-increment: none;
}

#permutatore .perm-step .perm-title::first-letter {
  text-transform: none;
}

#permutatore .perm-step .perm-title {
  text-indent: 0;
}

#permutatore .perm-step .perm-title span.step-number,
#permutatore .perm-step .perm-title b.step-number,
#permutatore .perm-step .perm-title .step-number {
  display: none !important;
}

#permutatore .perm-quote-media {
  text-align: center;
}

#permutatore .perm-quote-thumb {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 22px rgba(16, 24, 40, .08);
  display: block;
  margin: 0 auto;
}

@media (max-width:640px) {
  #permutatore .perm-quote-thumb {
    width: 96px;
    height: 96px;
  }
  /* Mobile sidebar fixes */
  #permutatore .permutatore-wrap { gap: 14px }
  #permutatore .perm-sidebar { position: static; top: auto; width: 100%; margin-top: 8px }
  #permutatore .perm-quote-card { padding: 16px; border-radius: 14px; box-shadow: 0 6px 16px rgba(16,24,40,.08) }
  #permutatore .perm-quote-title { font-size: 1rem }
  #permutatore .perm-quote-value { font-size: 1.6rem; line-height: 1.2 }
  #permutatore .perm-quote-sub { font-size: .88rem }
}