.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;

  .modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
  }

  .modal-content {
    background-color: var(--color-white);
    margin: 68px auto 0;
    max-height: calc(100vh - 110px);
    max-width: 605px;
    overflow-y: auto;
    padding: 36px 56px;
    position: relative;

    select {
      background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23C21B17'%3E%3Cpath d='M7.293 9.293c.36-.36.93-.39 1.32-.08l.09.08 3.3 3.3 3.29-3.29c.36-.36.93-.39 1.32-.08l.09.08c.36.36.39.93.08 1.32l-.08.09-4 4c-.36.36-.93.39-1.32.08l-.09-.08-4-4c-.39-.39-.39-1.03 0-1.42Z'/%3E%3C/svg%3E");
      background-position: right 0.5rem center;
      background-repeat: no-repeat;

      &:focus-visible {
        outline: none;
      }

      &:focus {
        border-bottom: 1px solid var(--color-red);
        outline: none;
      }
    }

    .modal-close {
      align-items: center;
      cursor: pointer;
      display: flex;
      gap: 14px;
      height: 24px;
      position: absolute;
      right: 56px;
      top: 50px;
      width: 24px;
      border: none;
      background-color: transparent;
      color: var(--color-red);
      font-size: 24px;
    }

    .modal-body {

      div[id^="edit-titulo-"] {
        padding-bottom: 32px;

        p {
          font-size: 32px;
          font-weight: 300;
          text-align: left;
          line-height: 2.5rem;
          margin-block-start: 0;
        }
      }

      #edit-titulo {
        padding-right: 50px;

        p {
          font-size: 2rem;
          font-weight: 300;
          line-height: 2.5rem;
          margin-block-start: 0;
        }
      }

      .form-type-select {
        margin: 0;
        max-width: none !important;
        margin-bottom: 1.5rem;

        h2 {
          font-size: 32px;
          font-weight: 300;
          text-align: left;
        }

        p {
          a {
            color: var(--color-red);
            text-decoration: none;
          }
        }

        select {
          appearance: none;
          background-color: transparent;
          border-bottom: 1px solid var(--color-gray);
          border-radius: 0;
          -webkit-box-sizing: border-box;
          box-sizing: border-box;
          color: var(--color-gray-darker);
          font-size: 20px;
          font-weight: 300;
          letter-spacing: 0;
          line-height: 28px;
          padding-bottom: 2px;
          -webkit-transition: all 0.3s ease-in-out;
          transition: all 0.3s ease-in-out;
          width: 100%;
          border-top: none;
          border-right: none;
          border-left: none;
          margin: 0;
          padding: 0;

          &:focus-visible {
            outline: none;
          }

          &:focus {
            border-bottom: 1px solid var(--color-red);
            outline: none;
          }
        }
      }

      .form-item-name {
        font-size: 20px;
        font-weight: 300;
        letter-spacing: 0;
        line-height: 28px;
        color: var(--color-gray-darker);
        margin: 0;
        max-width: none !important;
        margin-bottom: 1.5rem;

        input {
          -webkit-appearance: none;
          -moz-appearance: none;
          appearance: none;
          background-color: transparent;
          border-bottom: 1px solid var(--color-gray-light);
          border-radius: 0;
          -webkit-box-sizing: border-box;
          box-sizing: border-box;
          padding-bottom: 2px;
          -webkit-transition: all 0.3s ease-in-out;
          transition: all 0.3s ease-in-out;
          width: 100%;
          font-weight: 300;
          border-top: none;
          border-right: none;
          border-left: none;

          &:focus-visible {
            outline: none;
          }

          &:focus {
            border-bottom: 1px solid var(--color-red);
            outline: none;
          }
        }
      }

      .form-item-cellphone {
        font-size: 20px;
        font-weight: 300;
        letter-spacing: 0;
        line-height: 28px;
        color: var(--color-gray-darker);
        margin: 0;
        max-width: none !important;
        margin-bottom: 1.5rem;

        input {
          display: flex;
          -webkit-appearance: none;
          -moz-appearance: none;
          appearance: none;
          background-color: transparent;
          border-bottom: 1px solid var(--color-gray);
          border-radius: 0;
          -webkit-box-sizing: border-box;
          box-sizing: border-box;
          color: var(--color-gray-darker);
          font-size: 20px;
          font-weight: 300;
          letter-spacing: 0;
          line-height: 28px;
          padding-bottom: 2px;
          -webkit-transition: all 0.3s ease-in-out;
          transition: all 0.3s ease-in-out;
          width: 100%;
          border-top: none;
          border-right: none;
          border-left: none;

          &:focus-visible {
            outline: none;
          }

          &:focus {
            border-bottom: 1px solid var(--color-red);
            outline: none;
          }
        }
      }

      .form-type-checkbox {
        padding: 40px 0 0 20px;
        display: flex;
        gap: 10px;

        input[type="checkbox"]:checked:before {
          background-image: url(data:image/svg + xml;charset=utf-8,
 %3Csvgxmlns="http://www.w3.org/2000/svg" width="12.997" height="11.167" %3E%3Cpathfill="%2300D764" fill-rule="evenodd" d="M12.639.231c.39.33.47.89.2 1.31l-.07.1-7.7 9.17c-.36.43-1 .47-1.42.12l-.09-.09-3.3-3.67a.997.997 0 0 1 .07-1.41c.38-.34.95-.34 1.32-.01l.09.09 2.53 2.81 6.96-8.29c.36-.43.99-.48 1.41-.13Z" /%3E%3C/svg%3E);
          background-position: center;
          background-repeat: no-repeat;
          content: " ";
          display: block;
          height: 24px;
          width: 24px;
          top: 0;
        }

        input {
          background: var(--color-white);
          border: 1px solid var(--color-gray-darker);
          border-radius: 4px;
          content: " ";
          cursor: pointer;
          display: block;
          height: 24px;
          width: 24px;
        }
      }

      .funnel-title {
        font-size: 32px;
        font-weight: 300;
        text-align: left;
        letter-spacing: 0;
        margin: 0;
        padding-bottom: 35px;
        text-transform: uppercase;
        padding-right: 50px;
      }

      .button-container {
        width: 100%;
        margin-top: 40px;

        .button {
          display: block;
          width: 100%;
        }
      }

      &.call-me-back-form {
        form {
          div[data-drupal-messages] {
            display: none;
          }
        }

        .description {
          color: var(--color-gray-darker);
          font-size: 14px;
          font-weight: 300;
          letter-spacing: 0.25px;
          line-height: 20px;
        }

        .legal-note-toggle-wrapper {
          padding: 10px 0 0;
          width: 100%;
        }

        .legal-note-toggle {
          background: none;
          border: none;
          color: var(--color-red);
          cursor: pointer;
          gap: .3rem;
          margin-left: 0;
          font-family: "Roboto", sans-serif;
          font-size: 1rem;
          font-weight: 600;
          display: flex;
          align-items: center;
          text-decoration: none;

          .caret-icon {
            display: block;
            height: 24px;
            width: 24px;
            background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23C21B17'%3E%3Cpath d='M7.293 9.293c.36-.36.93-.39 1.32-.08l.09.08 3.3 3.3 3.29-3.29c.36-.36.93-.39 1.32-.08l.09.08c.36.36.39.93.08 1.32l-.08.09-4 4c-.36.36-.93.39-1.32.08l-.09-.08-4-4c-.39-.39-.39-1.03 0-1.42Z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            transition: transform 0.3s ease;
          }

          &.open .caret-icon {
            transform: rotate(180deg);
          }
        }

        .form-item-driver {
          font-size: 20px;
          font-weight: 300;
          letter-spacing: 0;
          line-height: 28px;
          color: var(--color-gray-darker);
          margin: 0;
          max-width: none !important;
          padding-right: 50px;
        }

        input#edit-driver-age--2 {
          border: none;
          border-bottom: 1px solid var(--color-gray);
          width: 100%;
          font-size: 20px;
          color: var(--color-gray-darker);
          letter-spacing: 0;
          line-height: 28px;
        }

        p {
          color: var(--color-gray-darker);
          font-size: 14px;
          font-weight: 300;
          letter-spacing: 0.25px;
          line-height: 20px;
          margin-bottom: 15px;
        }

        .form-item-autorization {
          align-items: flex-start;
          display: flex;
          flex-wrap: wrap;
          gap: 14px;
          row-gap: 6px;
          margin: 0;
          max-width: none !important;
          padding: 0 0 24px 0;

          input[type="checkbox"] {
            appearance: none;
            background: var(--color-white);
            border-radius: 4px;
            cursor: pointer;
            height: 24px;
            width: 24px;
            position: relative;
            border: 0;
          }

          input[type="checkbox"]:checked:before {
            background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12.997' height='11.167'%3E%3Cpath fill='%2300D764' fill-rule='evenodd' d='M12.639.231c.39.33.47.89.2 1.31l-.07.1-7.7 9.17c-.36.43-1 .47-1.42.12l-.09-.09-3.3-3.67a.997.997 0 0 1 .07-1.41c.38-.34.95-.34 1.32-.01l.09.09 2.53 2.81 6.96-8.29c.36-.43.99-.48 1.41-.13Z'/%3E%3C/svg%3E");
            background-position: center;
            background-repeat: no-repeat;
            content: " ";
            display: block;
            height: 24px;
            width: 24px;
            top: 0;
            left: 0;
          }

          input {
            appearance: none;

            &:before {
              border: 1px solid #6f7072;
              background: #fff;
              border-radius: 4px;
              content: " ";
              cursor: pointer;
              display: block;
              height: 24px;
              width: 24px;
            }
          }

          label {
            color: var(--color-gray-darker);
            font-size: 14px;
            font-weight: 300;
            letter-spacing: 0.25px;
            line-height: 20px;
            margin-top: 2px;
            flex: 1;

            button {
              background-color: transparent;
              border-width: 0;
              padding: 0;
              font-size: 1rem;
              color: var(--color-red);
            }
          }

          .form-item--error-message {
            width: 100%;
            padding-top: 0;
            padding-left: 36px;
          }


        }

        .form-item-edad {
          font-size: 20px;
          font-weight: 300;
          letter-spacing: 0;
          line-height: 28px;
          color: var(--color-gray-darker);
          margin: 0;
          max-width: none !important;
          margin-bottom: 1.5rem;

          input {
            display: flex;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background-color: transparent;
            border-bottom: 1px solid var(--color-gray);
            border-radius: 0;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            color: var(--color-gray-darker);
            font-size: 20px;
            font-weight: 300;
            letter-spacing: 0;
            line-height: 28px;
            padding-bottom: 2px;
            -webkit-transition: all 0.3s ease-in-out;
            transition: all 0.3s ease-in-out;
            width: 100%;
            border-top: none;
            border-right: none;
            border-left: none;

            &:focus-visible {
              outline: none;
            }

            &:focus {
              border-bottom: 1px solid var(--color-red);
              outline: none;
            }
          }
        }

        .form-wrapper {
          display: flex;
          justify-content: end;
          margin: 0;
          max-width: none !important;
          margin-bottom: 1.875rem;

          .button {
            background-color: var(--color-red);
            color: var(--color-white);
          }

          &.form-actions.webform-actions {
            .button {
              background-color: var(--color-red);
              border: 2px solid var(--color-red);
              border-radius: 4px;
              color: var(--color-white);
              line-height: 20px;
              padding: 18px 30px;
              text-align: center;
              text-transform: uppercase;
              width: auto !important;
              cursor: pointer;
              font-weight: 700;

              &:hover {
                background-color: var(--color-red-dark);
                border-color: var(--color-red-dark);
                color: var(--color-white);
              }
            }
          }
        }

        .form-confirmation-message {
          p.text__title {
            color: var(--color-red);
            font-size: 1rem;
            position: relative;
            margin-top: 100px;

            &::before {
              content: "";
              position: absolute;
              bottom: 30px;
              background-image: url("data:image/svg+xml,%3Csvg width='50' height='50' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg' aria-hidden='true' focusable='false'%0A%3E%3Ccircle cx='32' cy='32' r='28' fill='none' stroke='%23C41E1E' stroke-width='4' /%3E%3Cpath d='M18 33 L28 42 L46 22' fill='none' stroke='%23C41E1E' stroke-width='4' /%3E%3C/svg%3E%0A");
              width: 50px;
              height: 50px;
            }
          }

          p.text__info {
            font-size: 1rem;
          }
        }

        .cmb-already-submitted {
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          text-align: center;
          padding: 40px 0;

          .text__title {
            color: var(--color-red);
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 10px;
            line-height: 1.2;
          }

          .text__info {
            font-size: 18px;
            font-weight: 400;
            color: var(--color-gray-darker);
            margin-bottom: 30px;
          }

          .success-icon {
            width: 80px;
            height: 80px;
            background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 64 64' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='32' cy='32' r='30' fill='none' stroke='%23E47A5D' stroke-width='2' /%3E%3Cpath d='M20 32 L28 40 L44 24' fill='none' stroke='%23E47A5D' stroke-width='2' /%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-size: contain;
          }
        }
      }

      /* CONTACT FORM */
      &.contact-form {
        .form-type-processed-text {
          margin-bottom: 40px;
        }

        .legal-note-toggle-wrapper {
          padding: 10px 0 0;
          width: 100%;
        }

        .legal-note-toggle {
          background: none;
          border: none;
          color: var(--color-red);
          cursor: pointer;
          gap: .3rem;
          margin-left: 0;
          font-family: "Roboto", sans-serif;
          font-size: 1rem;
          font-weight: 600;
          display: flex;
          align-items: center;
          text-decoration: none;

          .caret-icon {
            display: block;
            height: 24px;
            width: 24px;
            background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23C21B17'%3E%3Cpath d='M7.293 9.293c.36-.36.93-.39 1.32-.08l.09.08 3.3 3.3 3.29-3.29c.36-.36.93-.39 1.32-.08l.09.08c.36.36.39.93.08 1.32l-.08.09-4 4c-.36.36-.93.39-1.32.08l-.09-.08-4-4c-.39-.39-.39-1.03 0-1.42Z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            transition: transform 0.3s ease;
          }

          &.open .caret-icon {
            transform: rotate(180deg);
          }
        }

        .form-item-autorizacion,
        .form-item-rgpd {
          align-items: flex-start;
          display: flex;
          flex-wrap: wrap;
          gap: 14px;
          row-gap: 6px;
          margin: 0;
          max-width: none !important;
          padding: 0 0 24px 0;

          input[type="checkbox"] {
            appearance: none;
            background: var(--color-white);
            border-radius: 4px;
            cursor: pointer;
            height: 24px;
            width: 24px;
            position: relative;
            border: 0;
          }

          input[type="checkbox"]:checked:before {
            background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12.997' height='11.167'%3E%3Cpath fill='%2300D764' fill-rule='evenodd' d='M12.639.231c.39.33.47.89.2 1.31l-.07.1-7.7 9.17c-.36.43-1 .47-1.42.12l-.09-.09-3.3-3.67a.997.997 0 0 1 .07-1.41c.38-.34.95-.34 1.32-.01l.09.09 2.53 2.81 6.96-8.29c.36-.43.99-.48 1.41-.13Z'/%3E%3C/svg%3E");
            background-position: center;
            background-repeat: no-repeat;
            content: " ";
            display: block;
            height: 24px;
            width: 24px;
            top: 0;
            left: 0;
          }

          input {
            appearance: none;

            &:before {
              border: 1px solid #6f7072;
              background: #fff;
              border-radius: 4px;
              content: " ";
              cursor: pointer;
              display: block;
              height: 24px;
              width: 24px;
            }
          }

          label {
            color: var(--color-gray-darker);
            font-size: 14px;
            font-weight: 300;
            letter-spacing: 0.25px;
            line-height: 20px;
            margin-top: 2px;
            flex: 1;

            button {
              background-color: transparent;
              border-width: 0;
              padding: 0;
              font-size: 1rem;
              color: var(--color-red);
            }
          }

          .form-item--error-message {
            width: 100%;
            padding-top: 0;
            padding-left: 36px;
          }

          .legal-note-toggle-wrapper,
          .description {
            margin-left: 38px;
            width: calc(100% - 38px);
          }
        }

        .form-item-dni {
          font-size: 20px;
          font-weight: 300;
          letter-spacing: 0;
          line-height: 28px;
          color: var(--color-gray-darker);
          margin: 0;
          max-width: none !important;
          padding-right: 50px;

          input {
            display: flex;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background-color: transparent;
            border-bottom: 1px solid var(--color-gray);
            border-radius: 0;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            color: var(--color-gray-darker);
            font-size: 20px;
            font-weight: 300;
            letter-spacing: 0;
            line-height: 28px;
            padding-bottom: 2px;
            -webkit-transition: all 0.3s ease-in-out;
            transition: all 0.3s ease-in-out;
            width: 100%;
            border-top: none;
            border-right: none;
            border-left: none;
            margin-bottom: 1.5rem;

            &:focus-visible {
              outline: none;
            }

            &:focus {
              border-bottom: 1px solid var(--color-red);
              outline: none;
            }
          }
        }

        .form-item-required-fields-text {
          font-size: 14px;
          font-weight: 700;
          color: var(--color-gray-darker);
          margin-bottom: 15px;
        }

        .form-item-phone-or-mail {
          font-size: 20px;
          font-weight: 300;
          letter-spacing: 0;
          line-height: 28px;
          color: var(--color-gray-darker);
          margin: 0;
          max-width: none !important;
          padding-right: 50px;
          margin-bottom: 1.5rem;

          input {
            display: flex;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background-color: transparent;
            border-bottom: 1px solid var(--color-gray);
            border-radius: 0;
            -webkit-box-sizing: border-box;
            box-sizing: border-box;
            color: var(--color-gray-darker);
            font-size: 20px;
            font-weight: 300;
            letter-spacing: 0;
            line-height: 28px;
            padding-bottom: 2px;
            -webkit-transition: all 0.3s ease-in-out;
            transition: all 0.3s ease-in-out;
            width: 100%;
            border-top: none;
            border-right: none;
            border-left: none;
            
            &:focus-visible {
              outline: none;
            }

            &:focus {
              border-bottom: 1px solid var(--color-red);
              outline: none;
            }
          }
        }

        .description {
          color: var(--color-gray-darker3);
          font-size: 14px;
          font-weight: 300;
          letter-spacing: 0.25px;
          line-height: 20px;
        }
      }

      .form-item--error-message {
        padding-top: 4px;

        strong {
          color: var(--color-red);
          font-size: .875rem;
          font-weight: 300;
          letter-spacing: 0;
          line-height: 1.4;
        }
      }
    }
  }

  .ajax-progress {
    display: none;
  }
}

@media (max-width: 768px) {
  .modal-content {
    margin: 16px auto 0;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px 30px !important;
  }

  .form-wrapper {
    justify-content: center !important;
    padding: 0 !important;
  }
}

[data-modal-target="#call-me-back-modal"]+.field--type-webform,
[data-modal-target="#contact-form-modal"]+.field--type-webform {
  display: none;
}

.modal {
  .modal-content {
    .modal-body {
      form.webform-submission-contact-form-form {
        display: flex;
        flex-direction: column;

        #edit-titulo,
        .form-item-name {
          order: 1;
        }

        .form-item-phone-or-mail,
        .form-item-dni,
        .form-item-required-fields-text {
          padding-right: 0;
          order: 1;
        }

        .form-type-checkbox,
        .form-type-checkbox {
          order: 3;
          padding-left: 0;
        }

        .form-type-checkbox {
          padding: 26px 0 0 0;
        }

        .form-actions.webform-actions {
          order: 2;
          display: flex;
          justify-content: center;
          align-items: center;

          input {
            background-color: var(--color-red);
            border: 2px solid var(--color-red);
            border-radius: 4px;
            color: var(--color-white);
            font-size: 1rem;
            text-transform: uppercase;
            padding: 18px 30px;
            cursor: pointer;
            width: 100%;
            font-weight: 700;

            &:hover {
              background-color: var(--color-red-dark);
              border-color: var(--color-red-dark);
            }
          }
        }
      }
    }
  }
}