/*******************************/
/********** VARIABLES **********/
/*******************************/
/* USE UNITS */
/*******************************/
/********** NORMALIZE **********/
/*******************************/
* {
  box-sizing: border-box;
  font-family: var(--font-family);
}

:host(:defined) {
  position: relative;
  display: block;
  font-size: 0;
}

:host([type=checkbox]),
:host([type=radio]) {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
}

/**********************************/
/********** CUSTOM INPUT **********/
/**********************************/
input,
textarea {
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  display: inline-block;
  position: relative;
  font-size: 1rem;
  font-weight: 400;
  color: hsl(0, 0%, 5%);
  line-height: 1.15;
  padding: 15px 25px;
  background-color: white;
  border-radius: 30px;
  border: 2px solid hsl(0, 0%, 92%);
  width: 100%;
  margin: 0;
  z-index: 1;
  transition: z-index 0s 0.2s;
  resize: none;
}
input:focus, input *:focus,
textarea:focus,
textarea *:focus {
  box-shadow: none;
  outline: none;
}
input[disabled],
textarea[disabled] {
  opacity: 0.5;
  pointer-events: none;
}
:host(.invalid) input,
:host(.invalid) textarea {
  border-color: hsl(10, 80%, 50%);
}

textarea {
  border-radius: 15px;
}

/********** INFO DIV **********/
:host(:defined) > div:first-child {
  position: absolute;
  width: 65px;
  height: 100%;
  background: hsl(0, 0%, 98%);
  border: 2px solid hsl(0, 0%, 92%);
  z-index: 2;
  border-radius: 30px 0 0 30px;
}
:host(:defined) > div:first-child::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 5px;
  right: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  background: hsl(0, 0%, 59%);
  -webkit-mask: no-repeat center center;
          mask: no-repeat center center;
}
:host([type=color]) :host(:defined) > div:first-child::before {
  content: normal;
}

:host([type=price]) :host(:defined) > div:first-child::before {
  height: 18px;
  /* -webkit-mask-image: url("/assets/img/euro.svg");
          mask-image: url("/assets/img/euro.svg"); */
}

/* :host([type=date]) :host(:defined) > div:first-child::before {
  -webkit-mask-image: url("/assets/img/calendar.svg");
          mask-image: url("/assets/img/calendar.svg");
} */

:host([type=color]) :host(:defined) > div:first-child {
  border: none;
  background-color: white;
}

:host(:defined) > div:first-child label {
  position: absolute;
  width: 65px;
  height: 100%;
  background: hsl(0, 0%, 98%);
  z-index: 2;
  padding: 0;
  border-radius: 30px 0 0 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/********** PRICE / DATE **********/
:host([type=price]) input,
:host([type=date]) input {
  padding-left: 83px;
}
:host([type=price]) input + label,
:host([type=date]) input + label {
  left: 80px;
}

/********** COLOR **********/
:host([type=color]) input {
  padding-left: 83px;
}
:host([type=color]) input + label {
  left: 80px;
}

/********** RANGE **********/
:host([type=range]) input[type=number] {
  width: 120px;
  vertical-align: middle;
}
:host([type=range]) input[type=number] + .range-wrapper {
  margin-left: 40px;
}
:host([type=range]) .range-wrapper {
  display: inline-flex;
  align-items: flex-end;
  vertical-align: middle;
  height: calc(34px + 1.15rem);
  --progress: 0%;
}
:host([type=range]) .range-wrapper input[type=range] {
  padding: 0;
  border: none;
  height: 18px;
  width: 280px;
  background-color: transparent;
  overflow: hidden;
}
:host([type=range]) .range-wrapper input[type=range]::-webkit-slider-runnable-track {
  height: 5px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--progress), hsl(0, 0%, 92%) var(--progress));
  border-radius: 5px;
}
:host([type=range]) .range-wrapper input[type=range]::-moz-range-track {
  height: 5px;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--progress), hsl(0, 0%, 92%) var(--progress));
  border-radius: 5px;
}
:host([type=range]) .range-wrapper input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
          appearance: none;
  background-color: var(--primary);
  width: 18px;
  height: 18px;
  border-radius: 100%;
  margin-top: -7px;
  -webkit-transition: background-color 0.2s ease-in-out;
  transition: background-color 0.2s ease-in-out;
  cursor: grab;
}
:host([type=range]) .range-wrapper input[type=range]::-webkit-slider-thumb:hover {
  background-color: hsl(var(--primary-hue), var(--primary-saturation), 45%);
}
:host([type=range]) .range-wrapper input[type=range]::-webkit-slider-thumb:active {
  cursor: grabbing;
}
:host([type=range]) .range-wrapper input[type=range]::-moz-range-thumb {
  -moz-appearance: none;
       appearance: none;
  background-color: var(--primary);
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 100%;
  margin-top: -7px;
  -moz-transition: background-color 0.2s ease-in-out;
  transition: background-color 0.2s ease-in-out;
  cursor: grab;
}
:host([type=range]) .range-wrapper input[type=range]::-moz-range-thumb:hover {
  background-color: hsl(var(--primary-hue), var(--primary-saturation), 45%);
}
:host([type=range]) .range-wrapper input[type=range]::-moz-range-thumb:active {
  cursor: grabbing;
}
:host([type=range]) .range-wrapper span {
  font-size: 11px;
  color: hsl(0, 0%, 70%);
  line-height: 1;
  margin-bottom: 4px;
}
:host([type=range]) .range-wrapper span:first-child {
  margin-right: 10px;
}
:host([type=range]) .range-wrapper span:last-child {
  margin-left: 10px;
}
:host([type=range]) .range-wrapper span.range__tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: calc(var(--progress) + 9px);
  transform: translateX(-50%);
  font-size: 12px;
  color: white;
  padding: 8px 10px 7px;
  background-color: hsl(0, 0%, 70%);
  border-radius: 5px;
  margin: 0;
}
:host([type=range]) .range-wrapper span.range__tooltip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-top: 5px solid hsl(0, 0%, 70%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
:host([type=range]) .range-wrapper div {
  position: relative;
}
:host([type=range]) > label {
  margin-bottom: 20px;
}

:host([data-type=stepped-range]) .range-wrapper {
  height: auto;
}
:host([data-type=stepped-range]) .range-wrapper input[type=range] {
  height: 30px;
  border-radius: 0;
  width: calc(30px * var(--steps));
  -webkit-mask: repeat left center/30px url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle r="40" cx="50" cy="50"/></svg>');
          mask: repeat left center/30px url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle r="40" cx="50" cy="50"/></svg>');
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::-webkit-slider-runnable-track {
  height: 100%;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--progress), hsl(0, 0%, 92%) var(--progress));
  border-radius: 0;
  -webkit-mask: repeat left center/30px url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle r="40" cx="50" cy="50"/></svg>');
          mask: repeat left center/30px url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle r="40" cx="50" cy="50"/></svg>');
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::-moz-range-track {
  height: 100%;
  background: linear-gradient(to right, var(--primary) 0%, var(--primary) var(--progress), hsl(0, 0%, 92%) var(--progress));
  border-radius: 0;
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  border-radius: 0;
  margin: 0;
  cursor: auto;
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::-webkit-slider-thumb:hover {
  background-color: var(--primary);
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::-webkit-slider-thumb:active {
  cursor: auto;
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::-moz-range-thumb {
  width: 30px;
  height: 30px;
  border-radius: 0;
  margin: 0;
  cursor: auto;
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::-moz-range-thumb:hover {
  background-color: var(--primary);
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::-moz-range-thumb:active {
  cursor: auto;
}
:host([data-type=stepped-range]) .range-wrapper input[type=range]::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(var(--progress) + 15px - var(--progress) * 30);
  border-radius: 30px;
  background-color: var(--primary);
}

/********** CHECKBOX **********/
input[type=checkbox] {
  display: none;
}
input[type=checkbox] + label {
  display: inline-block;
  position: relative;
  margin: 0;
  width: 20px;
  height: 20px;
  background-color: white;
  border: 1px solid #dbd968;
  cursor: pointer;
  border-radius: 5px;
  transition: var(--transition);
}
:host(.invalid) input[type=checkbox] + label {
  border-color: hsl(10, 80%, 50%);
}

input[type=checkbox] + label::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: -3px;
  margin: auto;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  background-color: var(--primary);
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    width: 5px;
    height: 10px;
  border-radius: 0;
}

input[type=checkbox]:checked + label::after {
  opacity: 1;
  transition-delay: 130ms;
}

input[type=checkbox]:checked + label{
  background-color: var(--primary);
}

input[type=radio][data-type=image-radio] + label,
input[data-type=color-checkbox] + label,
input[data-type=image-checkbox] + label {
  margin-left: 3px;
  left: 0;
  top: 0;
} 


input[type=checkbox][data-type=form-checkbox] + label {
  width: 24px;
  height: 24px;
  background-color: white;
  border: 2px solid #d9d8d8;
}



input[type=checkbox][data-type=form-checkbox] + label::before, 
input[type=checkbox][data-type=form-checkbox] + label::after {
  content: "";
  position: absolute;
  bottom: 11px;
  left: 6px;
  right: 1px;
  width: 2px;
  height: 0px;
  transform: rotate(135deg);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  background-color: #000000;
  border-radius: 4px;
  transform-origin: bottom left;
}

input[type=checkbox][data-type=form-checkbox] + label::after {
  transform: rotate(40deg);
  left: 0px;
  height: 0px;
  bottom: 5px;
}
input[type=checkbox][data-type=form-checkbox]:checked + label::before {
  opacity: 1;
  height: 6px;
  transition-delay: 120ms;
}

input[type=checkbox][data-type=form-checkbox]:checked + label::after {
  opacity: 1;
  height: 10px;
  transition-delay: 450ms;
}

input#checkout-privacy[type=checkbox][data-type=form-checkbox]+label {
  background-color: transparent;
  border: 1px solid #4b4a4a;
}

input.not-filled#checkout-privacy[type=checkbox][data-type=form-checkbox]+label {
  background-color: transparent;
  border: 1px solid red;
}

input#checkout-privacy[type=checkbox][data-type=form-checkbox]+label::before,
input#checkout-privacy[type=checkbox][data-type=form-checkbox]+label::after {
  background-color: #ffffff;
}

input#checkout-privacy[type=checkbox][data-type=form-checkbox]+label+label {
  color: #8b8b8b;
  font-size: 0.688rem;
  letter-spacing: 0.22px;
  max-width: 70%;
  }

input#checkout-privacy[type=checkbox][data-type=form-checkbox]+label+label a {
  color: #ffffff;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0);
}

input#checkout-privacy[type=checkbox][data-type=form-checkbox]+label+label a:hover {
  border-bottom: 1px solid rgba(255, 255, 255, 1);
}

input[type=radio][data-type=image-radio] + label::after,
input[data-type=color-checkbox] + label::after,
input[data-type=image-checkbox] + label::after {
  background-color: transparent;
  width: 24px;
  height: 24px;
  pointer-events: none;
  border: 1px solid black;
  opacity: 0;
  transition: var(--transition);
  left: -4px;
  border-radius: 0;
} 

input[type=radio][data-type=image-radio] + label::after {
  left: -3px;
}

input[type=radio][data-type=box-radio] + label {
  width: 80px;
  height: 26px;
  border-radius: 0;
}

input[type=radio][data-type=box-radio] + label::after {

  background-color: transparent;
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 1px solid black;
}

input[type=radio][data-type=box-radio] + label + label {
  margin-left: 0;
  margin-top: 0;
  cursor: pointer;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  font-weight: 300;
  font-stretch: normal;
  font-style: normal;
  line-height: normal;
  letter-spacing: normal;
  text-align: left;
  color: #000;
}

input[data-type=color-checkbox]:checked + label::after,
input[data-type=image-checkbox]:checked + label::after {
  opacity: 1;
} 

input[type=checkbox] + label + label {
  margin-left: 10px;
  margin-top: 2px;
  cursor: pointer;
  color: hsl(0, 0%, 59%);
  font-size: 14px;
  font-weight: normal;
  font-stretch: normal;
  font-style: normal;
  letter-spacing: normal;
  max-width: 190px;
  -webkit-user-select: none;  
  -moz-user-select: none;    
  -ms-user-select: none;      
  user-select: none;
}


/****************** CONTACT FORM *************************/

input[type=checkbox][data-type=form-checkbox] + label + label {
  color: #201d1c;
  letter-spacing: 0.28px;
  max-width: 250px;
}

input[type=checkbox][data-type=form-checkbox] + label + label a {
  color: #000000;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 1);
}

input[type=checkbox][data-type=form-checkbox] + label + label a:hover {
  border-bottom: 1px solid rgba(0, 0, 0, 0);
}

.template.contact textarea + label,
.template.contact input + label {
  font-size: 1rem;
  color: #000000;
  background-color: #fbfbfb;
}

.template.contact textarea:focus + label {
  font-size: 0.75rem;
  color: rgb(179, 179, 179);
}


input[data-type=icon-checkbox] + label + span {
  content: "";
  width: 37px;
  display: inline-block;
  height: 20px;
  margin: 0 16px 0 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  -webkit-user-select: none;  
  -moz-user-select: none;    
  -ms-user-select: none;      
  user-select: none;
}



/********** RADIO **********/
input[type=radio] {
  display: none;
}
input[type=radio] + label {
  display: inline-block;
  position: relative;
  margin: 0;
  width: 20px;
  height: 20px;
  background-color: white;
  border: 1px solid #d9d8d8;
  cursor: pointer;
  border-radius: 100%;
  transition: var(--transition);
}
:host(.invalid) input[type=radio] + label {
  border-color: hsl(10, 80%, 50%);
}

input[data-type=checkout-radio] + label {
  width: 25px;
  height: 25px;
}


input[type=radio] + label::after {
  content: "";
  background-color: var(--primary);
  width: 8px;
  height: 8px;
  display:block;
  top: 0;bottom: 0;left: 0;right: 0;
  margin: auto;
  position: absolute;
  border-radius: 100%;
  opacity: 0;
  transition: var(--transition);
}

input[data-type=checkout-radio] + label::after {
  width: 13px;
  height: 13px;
}

input[type=radio]:checked + label::after {
  opacity: 1;
}

input[type=radio] + label + label {
  margin-left: 10px;
  margin-top: 2px;
  cursor: pointer;
  font-size: 14px;
  color: hsl(0, 0%, 59%);
}

input[data-type=checkout-radio] + label + label {
  font-size: 1rem;
  color: hsl(0, 0%, 0%);
  width: 80%;
}

/********** IMAGE RADIO **********/
:host([data-type=image-radio]) {
  display: block;
  width: 20px;
  max-width: 50%;
  /* flex: 0 0 95px; */
}

input[data-type=image-radio] + label {
  position: absolute;
  top: 30px;
  left: 15px;
  right: 15px;
  width: 20px;
  height: 20px;
  background-color: hsl(0, 0%, 5%);
  margin: auto;
  border: none;
  border-radius: 0;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}
input[data-type=image-radio]:checked + label {
  border: none;
}
input[data-type=image-radio] + label + label {
  display: block;
  background-color: hsl(0, 0%, 98%);
  padding: 90px 15px 15px;
  border: 2px solid hsl(0, 0%, 98%);
  border-radius: 10px;
  margin: 0;
  font-size: 12px;
  color: hsl(0, 0%, 5%);
  line-height: 1;
  text-align: center;
  transition: var(--transition);
}
input[data-type=image-radio]:checked + label + label {
  border-color: var(--primary);
}

/********** TOGGLE **********/
input[data-type=toggle] + label {
  width: 60px;
  height: 30px;
  background-color: hsl(349, 80%, 47%);
  border: none;
  border-radius: 30px;
}
input[data-type=toggle] + label::before {
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 6px);
  height: calc(100% - 6px) !important;
  background-color: white;
  border-radius: 100%;
  transition: all 0.2s ease-in-out;
  transform: none;
  opacity: 1;
}
input[data-type=toggle] + label::after {
  content: normal;
}
input[data-type=toggle]:checked + label {
  background-color: hsl(114, 60%, 43%);
}
input[data-type=toggle]:checked + label::before {
  transition-delay: 0ms;
  transform: translateX(calc(100% + 6px));
}
input[data-type=toggle] + label + label {
  font-size: 1rem;
  color: hsl(0, 0%, 5%);
  margin-top: 5px;
  margin-left: 20px;
}

/********** LABEL **********/
label {
  display: block;
  font-size: 1rem;
  font-weight: 300;
  font-stretch: normal;
  font-style: normal;
  line-height: 1.2rem;
  letter-spacing: normal;
  text-align: left;
  color: #000000;
  margin: 0;
}

input:not([type=checkbox], [type=radio]) + label, textarea + label {
  position: absolute;
  top: 0;
  left: 22px;
  padding: 0 5px;
  background-color: white;
  transform: translateY(19px);
  transition: all 0.2s ease-in-out;
  pointer-events: none;
  z-index: 1;
}

input:not([type=checkbox], [type=radio]):focus + label, textarea:focus + label,
:host(.has-value) input:not([type=checkbox], [type=radio]) + label,
:host(.has-value) textarea + label {
  font-size: 0.75rem;
  color: hsl(0, 0%, 70%);
  line-height: 1;
  transform: translateY(-0.5em);
}

label a {
  display: inline !important;
  color: var(--highlights);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease-in-out;
}
label a:hover, label a:focus {
  border-color: currentColor;
}

/********** MAXLENGTH COUNTER **********/
.counter {
  position: absolute;
  display: block;
  margin-right: 20px;
  font-size: 11px;
  font-weight: bold;
  color: hsl(0, 0%, 70%);
  line-height: 1;
  text-align: right;
  bottom: -4px;
  right: 0;
  z-index: 1;
  background: white;
  padding: 0 5px;
}
.counter--red {
  color: hsl(0, 94%, 53%);
}
.counter--yellow {
  color: hsl(31, 92%, 56%);
}
.counter--green {
  color: hsl(114, 60%, 43%);
}

/********** INFO TOOLTIP **********/
.tooltip {
  position: absolute;
  top: 0;
  right: 15px;
  background-color: white;
  padding: 5px;
  transform: translateY(calc(-50% + 2px));
  z-index: 1;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.tooltip::before {
  content: "";
  position: relative;
  display: block;
  width: 16px;
  height: 16px;
  -webkit-mask-image: url(/assets/custom-input/assets/info.svg);
          mask-image: url(/assets/custom-input/assets/info.svg);
  background-color: hsl(0, 0%, 92%);
  transition: inherit;
}
.tooltip:hover::before {
  background-color: var(--primary);
}
.tooltip span {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  width: -moz-max-content;
  width: max-content;
  max-width: 160px;
  transform: translateX(-50%);
  font-size: 12px;
  color: white;
  padding: 8px 15px 10px;
  background-color: hsl(0, 0%, 70%);
  border-radius: 5px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: inherit;
}
.tooltip span::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-top: 5px solid hsl(0, 0%, 70%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
}
.tooltip:hover span {
  opacity: 1;
  transition-delay: 100ms;
}

/********** VALIDATION WARNING **********/
.warning {
  display: block;
  margin-top: 5px;
  padding-left: 30px;
  font-size: 12px;
  font-weight: 500;
  color: hsl(10, 80%, 50%);
}


@media(max-width: 480px) {

  input:not([type=checkbox], [type=radio])+label,
  textarea+label {
      left: 10px;
    }
}