:root {
    --primary-color: #d3394c;
    --primary-disabled: #722040;
}

.js .inputfile {
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  z-index: -1;
  box-shadow: inset 1em 1em var(--primary-color);
}

.inputfile + label {
  max-width: 80%;
  font-size: 1.25rem;
  /* 20px */
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  display: inline-block;
  overflow: hidden;
  padding: 0.625rem 1.25rem;
  /* 10px 20px */
}

.no-js .inputfile + label {
  display: none;
}

.inputfile:focus + label,
.inputfile.has-focus + label {
  outline: 1px dotted #000;
  outline: -webkit-focus-ring-color auto 5px;
}

.inputfile + label svg {
  width: 1em;
  height: 1em;
  vertical-align: middle;
  fill: currentColor;
  margin-top: -0.25em;
  /* 4px */
  margin-right: 0.25em;
  /* 4px */
}

.inputfile-6 + label {
  color: var(--primary-color);
}

.inputfile-6 + label {
  border: 1px solid var(--primary-color);
  background-color: #f1e5e6;
  padding: 0;
}

.inputfile-6:focus + label,
.inputfile-6.has-focus + label,
.inputfile-6 + label:hover {
  border-color: var(--primary-disabled);
}
.primary {
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.1;
  display: grid;
  grid-template-columns: 1em auto;
  gap: 0.5em;
}
.primary + .primary {
  margin-top: 1em;
}

.download-btn {
  padding: 0.625rem 1.25rem;
}
.download-btn a {
  height: 100%;
  color: white;
  background-color: var(--primary-color);
  padding: 0.625rem 1.25rem;
  cursor: pointer;
}

.inputfile-6 + label span,
.inputfile-6 + label strong {
  padding: 0.625rem 1.25rem;
  /* 10px 20px */
}

.inputfile-6 + label span {
  width: 200px;
  min-height: 2em;
  display: inline-block;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  vertical-align: top;
}

.inputfile-6 + label strong {
  height: 100%;
  color: #f1e5e6;
  background-color: var(--primary-color);
  display: inline-block;
}


/*
=====
CORE STYLES
=====
*/

.toggle{
    --uiToggleSize: var(--toggleSize, 1.25rem);
    --uiToggleBorderWidth: var(--toggleBorderWidth, 2px);
    --uiToggleColor: var(--primary-color);
    display: var(--toggleDisplay, inline-flex);
    position: relative;
  }
  
  .toggle__input{
    /*
    The pattern by Sara Soueidan https://www.sarasoueidan.com/blog/inclusively-hiding-and-styling-checkboxes-and-radio-buttons/
    */
    width: var(--uiToggleSize);
    height: var(--uiToggleSize);
    opacity: 0;
  
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
  }
  
  /*
  1. Calculation of the gap for the custom checkbox
  */
  
  .toggle__label{
    display: inline-flex;
    min-height: var(--uiToggleSize);
    padding-left: calc(var(--uiToggleSize) + var(--toggleIndent, .4em));
  }
  
  .toggle__input:not(:disabled) ~ .toggle__label{
    cursor: pointer;
  }
  
  /*
  1. Ems helps to calculate size of the checkbox
  */
  
  .toggle__label::after{
    content: "";
    box-sizing: border-box;  
    width: 1em;
    height: 1em;
    font-size: var(--uiToggleSize); /* 1 */
  
    background-color: transparent;
    border: var(--uiToggleBorderWidth) solid var(--uiToggleColor);
  
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
  }
  
  .toggle__input:checked ~ .toggle__label::after{
    background-color: var(--uiToggleColor);
  }
  
  .toggle__text{
    margin-top: auto;
    margin-bottom: auto;
  }
  
  /*
  The arrow size and position depends from sizes of square because I needed an arrow correct positioning from the top left corner of the element toggle
  
  1. Ems helps to calculate size and position of the arrow
  */
  
  .toggle__label::before{
    content: "";
    width: 0;
    height: 0;
    font-size: var(--uiToggleSize); /* 1 */
  
    border-left-width: 0;
    border-bottom-width: 0;
    border-left-style: solid;
    border-bottom-style: solid;
    border-color: var(--toggleArrowColor, #fff);
  
    position: absolute;
    top: .5428em;
    left: .25em;
    z-index: 3;
  
    transform-origin: left top;
    transform: rotate(-40deg) skew(10deg);
  }
  
  .toggle__input:checked ~ .toggle__label::before{
    --uiToggleArrowWidth: var(--toggleArrowWidth, 2px);
  
    width: .4em;
    height: .2em;
    border-left-width: var(--uiToggleArrowWidth);
    border-bottom-width: var(--uiToggleArrowWidth);
  }
  
  /*
  States
  */
  
  /* disabled state */
  
  .toggle__input:disabled ~ .toggle__label{
    opacity: var(--toggleOpacityDisabled, .24);
    cursor: var(--toggleCursorDisabled, not-allowed);
    user-select: none;
  }
  
  /* 
  The animation of switching states
  */
  
  .toggle__input:not(:disabled) ~ .toggle__label::before{
    will-change: width, height;
    opacity: 0;
  }
  
  .toggle__input:not(:disabled):checked ~ .toggle__label::before{
    opacity: 1;
    transition: opacity .1s ease-out .25s, width .1s ease-out .5s, height .2s ease-out .3s;
  }
  
  .toggle__input:not(:disabled) ~ .toggle__label::after{
    will-change: background-color;
    transition: background-color .2s ease-out;
  }
  
  .page__toggle{
    margin-bottom: 1.25rem;
    font-size: var(--pageToggleTextFontSize);
  }

.inputfile-6:focus + label strong,
.inputfile-6.has-focus + label strong,
.download-btn a:hover,
.inputfile-6 + label:hover strong {
  color: #f1e5e6;
  background-color: var(--primary-disabled);
}

@media screen and (max-width: 50em) {
  .inputfile-6 + label strong {
    display: block;
  }
}
