:root {
  --hyundai-blue: #002c5f;
  --hyundai-light-blue: #007aff;
  --hyundai-light-bg: #f9fafb;
  --hyundai-border: #d2d5da;
  --hyundai-gray-bg: #e2e6ed;
  --hyundai-sand-bg: #F6F3F2;
  --hyundai-text-color: #1c1b1b;
  --font-family-head: 'HyundaiSansHead', sans-serif;
}

/* START SWITCH */
.n11-hyundai-calculator-form .switch-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 2.5rem 0.625rem;
}

.n11-hyundai-calculator-form .switch-wrapper .switch-button {
  background: #FFF;
  border-radius: 36px;
  overflow: hidden;
  width: 280px;
  max-width: 100%;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hyundai-blue);
  position: relative;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  outline: 2px solid var(--hyundai-border);
  outline-offset: 8px;
}

.n11-hyundai-calculator-form .switch-button:hover {
  transform: translateY(-1px);
}

.n11-hyundai-calculator-form .switch-button-checkbox {
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  opacity: 0;
  z-index: 3;
}

.n11-hyundai-calculator-form .switch-button-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 8px 0;
  user-select: none;
}

.n11-hyundai-calculator-form .switch-button-label::before {
  content: "";
  background: var(--hyundai-blue);
  height: 100%;
  width: 50%;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 36px;
  transform: translateX(0);
  transition: transform 350ms ease;
  z-index: 1;
}

.n11-hyundai-calculator-form .switch-option-left,
.n11-hyundai-calculator-form .switch-option-right {
  position: relative;
  width: 50%;
  text-align: center;
  z-index: 2;
  transition: color 350ms ease;
  cursor: pointer;
}

/* Actieve kleuren */
.switch-button-checkbox:not(:checked) ~ .switch-button-label .switch-option-left {
  color: #FFFFFF;
}

.switch-button-checkbox:checked ~ .switch-button-label .switch-option-right {
  color: #FFFFFF;
}

/* Schuif naar rechts */
.switch-button-checkbox:checked ~ .switch-button-label::before {
  transform: translateX(100%);
}

/* Keyboard focus zichtbaar */
.switch-button-checkbox:focus-visible + .switch-button-label {
  outline: 3px solid var(--hyundai-light-blue);
  outline-offset: 2px;
}

/* Transition bij klik */
.n11-hyundai-calculator-form .switch-button:active {
  transform: scale(0.985);
}
/* END SWITCH */

/* FIELDS */
.n11-hyundai-calculator-form .fields {
  background: #FFFFFF;
  padding: 1.5rem 0;

  margin: 3rem 0 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: padding 0.35s ease, background 0.3s ease;

  overflow: visible;
  position: relative; /* ensures tooltip positions correctly */
  z-index: 1;
}

.n11-hyundai-calculator-form .fields .fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 2rem 3rem;
  align-items: start;
  overflow: visible;
}

.n11-hyundai-calculator-form .fields .fields-row .fields-sub-row {
  flex-direction: column;
  gap: 1.5rem;
  align-items: start;
  display: none;
}

.n11-hyundai-calculator-form .fields .fields-row .fields-sub-row.show-on-model {
  gap: 0.5rem;
}

.n11-hyundai-calculator-form .fields .fields-row .fields-sub-row.active {
  display: flex;
}

/* === LABELS & INPUTS === */
.n11-hyundai-calculator-form .fields .n11-field .n11-label {
  font-size: 0.925rem;
  color: var(--hyundai-blue);
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1;
}

.n11-input {
  padding: 0.9rem 1rem;
  border: 1px solid var(--hyundai-border);
  background-color: #fff;
  font-size: 1rem;
  color: var(--hyundai-text-color);
  appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Euro input */
.input-euro {
  position: relative;
  color: var(--hyundai-blue);
}
.input-euro input {
  padding-left: 18px;
}
.input-euro:before {
  position: absolute;
  top: 14px;
  content: "€";
  left: 6px;
}

.n11-input:hover {
  border-color: #a9b1bb;
}

.n11-input:focus {
  outline: none;
  border-color: var(--hyundai-blue);
  box-shadow: 0 0 0 3px rgba(0, 44, 95, 0.15);
}

/* === SELECT === */
.n11-select {
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23002c5f' stroke-width='2' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 12px 8px;
  border: 2px solid var(--hyundai-border);
}

/* === RADIO === */
.n11-radio-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.n11-radio {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: normal;
  color: var(--hyundai-text-color);
  cursor: pointer;
}

.n11-radio input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--hyundai-border);
  border-radius: 50%;
  display: grid;
  place-content: center;
  background-color: #fff;
  transition: all 0.2s ease;
}

.n11-radio input[type="radio"]:focus {
  outline-width: 0;
}

.n11-radio input[type="radio"]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.2s ease;
  background-color: var(--hyundai-blue);
}

.n11-radio input[type="radio"]:checked::before {
  transform: scale(1);
}

.n11-hyundai-calculator-form .fields .n11-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: #FFFFFF;
  border-radius: 4px;
  width: 100%;

  pointer-events: none;
  opacity: 0;
  max-height: 0;
  max-width: 0;
  transform: translateY(-6px);
  overflow: hidden;
  transition:
          opacity 0.35s ease 0.15s,
          max-height 0.45s ease,
          transform 0.35s ease 0.1s,
          background 0.3s ease;
}

/* HORIZONTAL, used for fiscale waarde display. */
.n11-hyundai-calculator-form .fields .n11-field.n11-field-horizontal {
  flex-direction: row !important;
  align-items: center;
}

.n11-hyundai-calculator-form .fields .n11-field.n11-field-horizontal .n11-label {
  margin-bottom: 0;
  color: var(--hyundai-text-color);
  font-weight: normal;
  font-size: 0.825rem;
}

.n11-hyundai-calculator-form .fields .n11-field.n11-field-horizontal span {
  font-size: 0.825rem !important;
}


.n11-hyundai-calculator-form .fields .n11-field.active {
  opacity: 1;
  max-height: 260px;
  max-width: 100%;
  transform: translateY(0);
  pointer-events: all;
  transition:
          opacity 0.35s ease 0.1s,
          max-height 0.45s ease,
          transform 0.35s ease 0.1s;
}

.n11-hyundai-calculator-form fieldset {
  border: none;
  background: var(--hyundai-gray-bg);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
  line-height: 1;

  padding-left: 0;
  margin-left: 0;
}
/* END FIELDS */

/* === RESULT === */
.n11-hyundai-calculator-form .fields .n11-field.n11-result {
  background: var(--hyundai-sand-bg) !important;
  padding: 3rem 2rem 2rem 2rem;
  margin-top: -3rem;
  overflow: visible;
}

.n11-hyundai-calculator-form .fields .n11-field.n11-result h4 {
  font-size: 0.925rem;
  color: var(--hyundai-blue);
  margin: 0;
  font-weight: 600;
}

.n11-hyundai-calculator-form .fields .n11-field.n11-result .n11-result-value {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
  color: var(--hyundai-blue);
  font-family: var(--font-family-head);
}

/* === CTA BUTTON === */
.n11-btn {
  display: none;
  font-family: var(--font-family-head);
  background: var(--hyundai-blue);
  color: #fff;
  padding: 1rem 1.5rem;
  font-weight: 400;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.2s ease;
}

.n11-btn.active {
  display: inline-flex;
  justify-content: center;
}

.n11-btn-wrapper {
  display: flex;
  justify-content: flex-end;
}

.n11-btn:hover {
  background: #003b8e;
  transform: translateY(-2px);
}

.n11-btn:focus-visible {
  outline: 3px solid var(--hyundai-light-blue);
  outline-offset: 3px;
}

/* === FOOTER / ALIGN === */
.n11-footer {
  margin-top: 2rem;
}

/* === LOADING SPINNER (inline Hyundai style) === */
.n11-loader {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  border-radius: 6px;

  backdrop-filter: blur(2px);
}

.n11-loader.active {
  opacity: 1;
  pointer-events: all;
}

.n11-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #d9dbe1;
  border-top: 4px solid var(--hyundai-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ERROR */
.n11-error-message {
  color: #c0392b;
  font-size: 0.85rem;
  margin-top: 0.3rem;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 0.3s ease;
  min-height: 0;
}

.n11-error-message.active {
  opacity: 1;
  min-height: 1em;
}

.n11-field input:invalid,
.n11-field input.error {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

/* Info icon */
.n11-label-with-info {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.n11-hyundai-calculator-form .fields .n11-label-with-info .n11-label {
  margin-bottom: 0;
}

.n11-tooltip {
    position: fixed;
    background: #fff;
    color: #1c1b1b;
    font-size: 0.825rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d2d5da;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 44, 95, 0.1);
    max-width: min(320px, 90vw);
    z-index: 999999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    display: none;
    box-sizing: border-box;
}


.n11-tooltip.visible {
    opacity: 1 !important;
}


.n11-info-icon {
  position: relative;
  line-height: 1;
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline-width: 0;
  margin: -4px 0.4rem 0 0.4rem;
}

.n11-info-icon svg {
  width: 1.3rem;
  height: 1.3rem;
  color: var(--hyundai-blue);
}

.n11-info-icon:hover svg,
.n11-info-icon:focus-visible svg {
  color: #004a99;
  outline: none;
}

/*!* Tooltip container *!*/
/*.n11-info-icon::after {*/
/*  content: attr(data-info);*/
/*  position: absolute;*/
/*  bottom: calc(100% + 8px);*/
/*  !* Center the tooltip over the icon so it doesn't overflow left/right *!*/
/*  left: 50%;*/
/*  transform: translateX(-50%);*/
/*  background: #fff;*/
/*  color: #1c1b1b;*/
/*  font-size: 0.825rem;*/
/*  font-weight: normal;*/
/*  text-align: left;*/
/*  line-height: 1.2;*/
/*  padding: 0.5rem 0.75rem;*/
/*  border: 1px solid #d2d5da;*/
/*  border-radius: 4px;*/
/*  box-shadow: 0 4px 8px rgba(0, 44, 95, 0.1);*/
/*  white-space: normal;*/
/*  !* Allow the tooltip to size to content but never exceed the viewport *!*/
/*  width: max-content;*/
/*  max-width: min(90vw, 320px);*/
/*  box-sizing: border-box;*/
/*  overflow-wrap: anywhere;*/
/*  word-break: break-word;*/
/*  opacity: 0;*/
/*  visibility: hidden;*/
/*  pointer-events: none;*/
/*  transition: opacity 0.2s ease, transform 0.2s ease;*/
/*  z-index: 100;*/
/*}*/

/*.n11-info-icon:hover::after,*/
/*.n11-info-icon:focus-visible::after {*/
/*  opacity: 1;*/
/*  visibility: visible;*/
/*  transform: translateX(-50%) translateY(-2px);*/
/*}*/

.n11-hyundai-calculator-form .fields.free-mode .n11-field.n11-result button.n11-info-icon {
  display: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .n11-hyundai-calculator-form {
    overflow: hidden;
  }

  .n11-hyundai-calculator-form .fields {
    margin: 1.5rem 0 1rem 0;
  }

  .n11-hyundai-calculator-form .fields .fields-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .n11-hyundai-calculator-form .fields .n11-result {
    margin-top: 0;
  }

  .switch-button {
    width: 100%;
  }

  .n11-hyundai-calculator-form .fields .n11-field .n11-label, .n11-hyundai-calculator-form .fields .n11-field .n11-label-with-info {
    margin-bottom: 0.15rem;
  }

  .n11-hyundai-calculator-form .fields .n11-field .n11-label-with-info .n11-label {
    margin-bottom: 0;
  }

  .n11-hyundai-calculator-form .fields .n11-field.n11-result {
    margin-top: 0;
  }

  .n11-hyundai-calculator-form  .n11-radio-group {
    margin-top: 0.25rem;
    gap: 0.5rem;
  }

  .n11-hyundai-calculator-form .switch-wrapper {
    margin: 3rem .625rem 0.5rem .625rem
  }

  .n11-hyundai-calculator-form .switch-wrapper .switch-button {
    width: 220px;
    font-size: 0.8rem;
    outline: 1px solid var(--hyundai-border);
    outline-offset: 4px;
  }
}
