:root {
  --teal: #006778;                /* ARVO BRAND */
  --teal-darkest: #0A444E;        /* ARVO DARK */
  --gray: #A2A2A2;                /* ARVO DARK GRAY */
  --gray-lighter: #C6C6C6;        /* arvo vastaussovellus custom: disabled send-button */
  --white-darker: #F5F5F5;        /* ARVO LIGHT GRAY */
  --gray-blue: #9BF0FD;           /* ARVO HIVIS */
  --yellow-light: #FFEFD2;        /* ARVO TRAFFICLIGHT ORANGE LIGHT */
  --green: #489707;               /* ARVO TRAFFICLIGHT GREEN */
  --green-light: #D9F8BF;         /* ARVO TRAFFICLIGHT GREEN LIGHT */
  --red: #B90729;                 /* ARVO TRAFFICLIGHT RED */
  --black: #000000;               /* ARVO TEXT BLACK */
  --white: #FFFFFF;               /* arvo custom: background, text or borders on top of darker colors, CSC logo on top of Arvo Brand color */

  --brand-focus: 2px solid var(--teal);         /* Focus outline for light background */
  --hivis-focus: 2px solid var(--gray-blue);    /* Focus outline for dark background */
}

html,
body {
  font-family: "Open Sans", "Arial", sans-serif;
  text-rendering: auto;
  font-size: 14px;
  margin: 0;
  padding: 0;
  line-height: 24px;
  color: var(--black);
}

@font-face {
  font-family: 'Open Sans';
  font-weight: 400;
  src: url("../font/opensans.woff") format("woff");
}

@font-face {
  font-family: 'Open Sans';
  font-weight: 600;
  src: url("../font/opensans-semibold.woff") format("woff");
}

@font-face {
  font-family: 'Open Sans';
  font-weight: 700;
  src: url("../font/opensans-bold.woff") format("woff");
}

@font-face {
  font-family: 'Open Sans Condensed';
  font-weight: 300;
  src: url("../font/opensans-condensed-light.woff") format("woff");
}

@font-face {
  font-family: 'Open Sans Condensed';
  font-weight: 700;
  src: url("../font/opensans-condensed-bold.woff") format("woff");
}

.app-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 6px;
}

/* BANNER; NAVIGATION */

.main-nav {
  background-color: var(--teal);
  min-height: 40px;
  font-size: 1em;
  overflow: hidden;
}

.main-nav a {
  display: inline-block;
  text-decoration: none;
  color: var(--white);
  text-transform: uppercase;
  font-weight: 700;
}

.main-nav ul {
  margin: 0;
  padding: 0;
  *zoom: 1;
}

.main-nav ul li {
  margin: 5px;
  float: left;
  height: 30px;
  display: table;
}

.main-nav ul li a:focus {
  outline: var(--hivis-focus);
  border: 1px solid var(--gray-blue);
  border-radius: 4px;
}

.main-nav ul li:hover, .main-nav ul li.active {
  background-color: var(--teal-darkest);
}

.main-nav ul li a {
  border: 1px solid var(--white);
  border-radius: 4px;
  display: table-cell;
  vertical-align: middle;
  padding: 0 12px;
  cursor: pointer;
}

.main-nav .kielen-vaihto {
  float: right;
  overflow: auto;
}
/* banner text */
p.arvo-title {
  text-transform: uppercase;
  margin: 0 0 0 10px;
  border-left: 1px solid var(--white);
  line-height: 40px;
  font-weight: 600;
  color: var(--white);
  padding-left: 1em;
  float: left;
}
/* notices below banner */
div.esikatselu {
  background-color: var(--yellow-light);
  height: 45px;
  line-height: 100%;
  padding-left: 50px;
  display: flex;
  align-items: center;
  span {
    line-height: 45px;
    padding-left: 5px;
    font-weight: 700;
    font-size: 20px;
  }
  svg {
    font-size: 30px;
    color: var(--red);
  }
}

.notification-alert-wrapper {
  position: sticky;
  top: 42px;
  left: 50%;
  height: 0;
  width: 0;
  overflow: visible;
  z-index: 1041;
}

.notification-alert {
  transform: translateX(-50%);
  min-width: 350px;
  margin-bottom: 2px;
  background-color: var(--green-light);
  font-size: 14px;
  color: var(--black);
  .MuiAlert-icon {
    align-items: center;
    color: var(--green);
    opacity: unset;
  }
  svg {
    width: 1.3em;
    height: 1.3em;
  }
  .MuiTouchRipple-root {
    display: none;
  }
  .MuiAlert-action {
    button:focus, button:hover {
      outline: var(--brand-focus);
      border-radius: 4px;
    }
  }
}

/* MAIN CONTENT */

h1 {
  font-family: "Open Sans Condensed", "Arial", sans-serif;
  font-weight: 700;
  font-size: 2.5em;
  line-height: 48px;
  margin-bottom: 24px;
  text-transform: uppercase;
  text-align: center;
  color: var(--black); }

/* h1 and legend are not interactable, just given focus programmatically to aid screenreaders and navigation */
h1:focus, legend:focus {
  outline: 0;
}

h2 {
  font-family: "Open Sans Condensed", "Arial", sans-serif;
  margin-bottom: 12px;
  font-weight: 300;
  font-size: 2.14285714285714em;
  text-transform: uppercase;
  border-bottom: 3px solid var(--black);
  padding-bottom: .3em;
}

h2.johdanto {
  border-bottom: none;
}

#accordion {
  color: var(--teal);
  flex-direction: row-reverse;
  padding: 0;
  div {
    margin: 0;
  }
  svg {
    color: var(--teal);
    font-size: 25px;
  }
  &.heading {
    color: var(--black);
    svg {
      font-size: 40px;
    }
  }
  &:focus, &:hover {
    outline: var(--brand-focus);
    border-radius: 4px;
    background-color: transparent;
  }
}

dl.contact-info dd {
  margin-left: 0;
}

h3 {
  font-family: "Open Sans Condensed", "Arial", sans-serif;
  margin-bottom: .1em;
  font-size: 1.42857142857143em;
}

/* Links in text */
p > a {
  color: var(--teal);
  text-decoration: none;
}

p > a:hover {
  color: var(--teal-darkest);
  text-decoration: underline;
}

p > a:focus {
  outline: var(--brand-focus);
}

/* home page */
.title {
  display: inline-flex;
}

.title h1{
  margin-top: 2em;
}

/* Move! logo */
img.logo {
  height: 8em;
  display: block;
  margin: auto;
}

div.error-page, div.kiitos-page, div.loading {
  margin-top: 3em;
}

.loading {
  text-align: center;
}

/* QUESTIONNAIRE */

.kysely-selite {
  white-space: pre-line;
  margin-bottom: 12px;
}

.plain-selection {
  padding: 1em;
}

.plain-selection label.plain-label {
  background-image: url("../img/helppolukuinen.svg");
  background-position-x: 2.2em;
  background-repeat: no-repeat;
  background-size: 2.2em;
  height: 2.2em;
}

.plain-selection label.plain-label input {
  margin-right: 3.2em;  /* .plain-selection padding + .plain-label background-position-x */
}

/* questions */
fieldset {
  border: none;
}

.kysymys {
  border-bottom: 1px solid #757575;
  -webkit-transition: all 600ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
  transition: all 700ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
  padding: 1em;
}

.kysymys-ohjeteksti {
  white-space: pre-line;
  padding-top: 1em;
  padding-bottom: 1em;
}

.jatkokysymys {
  padding-left: 30px;
}

.kysymys h3 {
  padding: 0;
  margin: .05em 0 0.7em;
}

.taulu-solu h3 {
  padding: 0;
  margin: 0 0; /* Tiivistää matriisia hieman */
}

.question-feedback {
  padding: 0 13px;
  margin: 0;
  span {
    display: flex;
    align-items: center;
    svg {
      padding-right: .3em;
    }
  }
  .unanswered {
    color: var(--red);
  }
}

/*
display:none vaatii span wrappayksen joka aiheuttaa sr ongelmia
visibility: hidden jättää tekstin syömän tilan jolloin monivalintojen kanssa tulee ongelmia
*/
.piilotettu-tyopoydalla {
  font-size: 0;
}

label.piilotettu-tyopoydalla > input {
  font-size: 14px;
}

.screenreader-only {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
}

.kysymysryhma {
  margin-top: 2em;
}

.kysymysryhma .kysymys:last-child {
  border-bottom: 0;
}

/* radio buttons and checkboxes */
.vastaus-valinnat {
  display: flex;
  flex-direction: column;
}

.vastaus-valinnat label {
  display: flex;
  align-items: center;
  margin: .25em 28px .25em 0;
}

.vastaus-valinnat label input {
  margin-right: 1.25em;
}

.vastaus-valinnat div {
  /* yleensä label on sisältämänsä tekstin kokoinen mutta koska näin ei ole pitää teksti erikseen keskittää */
  display: flex;
  align-items: normal;
  padding-left: 1.25em;
}

.vastaus-valinnat.compact {
  flex-direction: row;
}

.teksti-painikkeen-paalla {
  /* Nostaa label tekstit matriisissa painikkeiden yläpuolelle */
  flex-direction: column-reverse;
  /* Poistaa ylimääräisen tilan ensimmäisen matriisikysymystekstin alla */
  vertical-align: bottom;
}

label.teksti-painikkeen-paalla > input {
  position: inherit;
  top: 0;
}

.taulu {
  display: table;
  .unanswered {
    padding-bottom: 18px;
  }
}

.taulu-rivi {
  display: table-row;
}

.taulu-solu {
  display: table-cell;
}

.taulu-rivi .taulu-solu:first-child {
  width: 350px;
  padding-right: 30px;
}

.taulu-solu .vastaus-valinnat.compact label input {
  margin: 0;  /* Tiivistä matriisia */
}

.pakollinen-matriisissa:after {
  content: "*";
  color: var(--red);
  font-weight: 700;
}

.radio-ikoni {
  padding-right: 1em;
  width: 2em;
  height: 2em;
  vertical-align: middle;
  display: inline-block;  /* div käyttäytymään img tapaan */
}

/* checkbox https://moderncss.dev/pure-css-custom-checkbox-style/ */
input[type="checkbox"] {
  /* Add if not using autoprefixer */
  -webkit-appearance: none;
  /* Remove most all native input styles */
  appearance: none;
  /* For iOS < 15 */
  background-color: var(--white);
  /* Not removed via appearance */
  margin: 0;

  font: inherit;
  color: currentColor;
  width: 1.285em;
  height: 1.285em;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--teal);
  border-radius: 0.15em;
  transform: translateY(-0.075em);

  display: grid;
  place-content: center;

  cursor: pointer;
}
input[type="checkbox"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  aspect-ratio: 1 / 1;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transform-origin: bottom left;
  transition: 120ms transform ease-in-out;
  /*box-shadow: inset 1px 1px var(--white);*/
  /* Windows High Contrast Mode */
  background-color: var(--teal);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* /checkbox */

/* radio https://moderncss.dev/pure-css-custom-styled-radio-buttons/#demo */
input[type="radio"] {
  /* Add if not using autoprefixer */
  -webkit-appearance: none;
  /* Remove most all native input styles */
  appearance: none;
  /* For iOS < 15 */
  background-color: var(--white);
  /* Not removed via appearance */
  margin: 0;

  font: inherit;
  color: currentColor;
  width: 1.285em;
  height: 1.285em;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--teal);
  border-radius: 50%;
  transform: translateY(-0.075em);

  display: grid;
  place-content: center;

  cursor: pointer;
}

input[type="radio"]::before {
  content: "";
  width: 0.65em;
  height: 0.65em;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 0 0 0 1px var(--white);
  /* Windows High Contrast Mode */
  background-color: var(--teal);
}

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

/* /radio */

label.compact:before {
  top: .1em;
}

/* Mouse hover and focus indicator */
.vastaus-valinnat label:focus-within,
.vastaus-valinnat label:hover {
  outline: var(--brand-focus);
}
/* Älä käytä yllä olevaa kohdistus indikaattoria luku ja textarea kanssa */
.luku:first-child:focus-within,
.luku:first-child:hover,
.vastaus-valinnat label:has(> textarea):hover,
.vastaus-valinnat label:has(> textarea):focus-within,
.vastaus-valinnat label:has(> select):hover,
.vastaus-valinnat label:has(> select):focus-within
{
  outline: inherit;
}

.vastaus-valinnat label:hover {
  cursor: pointer;
}

.kysymys textarea {
  width: 20em;
  height: 5em;
}

.kysymys textarea.single-row {
  height: 2em;
}

/* Focus ring for different form controls */
.kysymys textarea:focus,
.vastaus-valinnat .luku:first-child input:focus,
select:focus {
  outline: var(--brand-focus);
  outline-offset: 1px;
}

.validation-error {
  color: var(--red);
}

.redirect {
  list-style: none;
  padding-left: 0;
}

/* SENDING AND UNANSWERED REQUIRED QUESTIONS */

.answer-controls {
  border-top: 1px solid #757575;
  padding: 1em;
}

.required-notice {
  padding: 1em;
}

.required-notice h2 {
  border-bottom: none;
  font-size: 1.5em;
  text-transform: none;
  font-weight: 700;
}

.required-notice ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.required-notice li {
  padding-left: 2em;
  margin-top: .5em;
  background-image: url("../img/arrow_right.svg");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: 1.1em;
}

.required-notice a {
  color: var(--teal);
  text-decoration: none;
}

.required-notice a:focus {
  outline: var(--brand-focus);
}

.required-notice a:hover {
  color: var(--teal-darkest);
  text-decoration: underline;
}

button.arvo {
  background-color: var(--teal);
  color: var(--white);
  background-image: url("../img/send-white.svg");
  background-repeat: no-repeat;
  background-position: 15px 50%;
  border: none;
  border-radius: 4px;
  height: 36px;
  margin: 6px 24px 6px 0;
  cursor: pointer;
  padding: 0 15px 0 40px;
  font-size: 14px;
  font-family: "Open Sans", "Arial", sans-serif;
}

button.arvo:hover {
  background-color: var(--teal-darkest);
}

button.arvo:focus {
  outline: var(--brand-focus);
  outline-offset: 1px;
}

button.arvo.disabled {
  background-color: var(--gray-lighter);
  color: var(--black);
  background-image: url("../img/send-black.svg");
  border: 1px solid var(--black);
  border-radius: 4px;
  cursor: not-allowed;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* TODO: Find out how to test this error message */
div.error {
  background-color: #bd362f;
  display: flex;
  align-items: center;
  min-height: 3em;
  margin: auto;
  padding: 1em;
}

div.error span {
  color: var(--white);
}

/* FOOTER */
footer {
  margin-top: 5em;
}

footer.disclaimer-footer {
  background-color: var(--teal);
}

footer.disclaimer-footer .app-wrapper {
  color: var(--white);
  background: url("../img/csc-logo-nega.png") right 10px center no-repeat;
  padding: 20px 10px 10px 10px;
}

footer.disclaimer-footer .app-wrapper p {
  font-size: .85em;
}

footer.disclaimer-footer .app-wrapper p.palveluntarjoaja {
  font-size: 1em;
  margin: 0 0 10px 0;
}

.copyright {
  color: var(--white);
  margin-top: 5em;
}

footer a {
  color: var(--gray-blue);
  text-decoration: underline;
}

footer a:hover {
  color: var(--gray-blue);
}

footer a:focus {
  outline: var(--hivis-focus);
}

/* RESPONSIIVISET
------------------------------------------------------------------------------*/
@media screen and (max-width: 590px) {
  h1 {
    font-size: 1.6em;
  }

  h2 {
    font-size: 1.4em !important;
  }

  h3 {
    font-size: 1.2em;
  }

  textarea {
    width: 90% !important;
  }

  .main-nav .kielen-vaihto {
    text-align: center;
    padding-bottom: .5em;
    width: 100%;
  }

  .main-nav .kielen-vaihto li {
    border: 0 !important;
    height: 2em;
    width: 50%;
  }

  .main-nav .kielen-vaihto li a {
    display: block;
  }

  .vastaus-valinnat {
    flex-direction: column;
  }

  .vastaus-valinnat.compact {
    flex-direction: column;
    margin: .5em 0;
  }

  /* Lisäkokoa mobiilipainikkeille */
  .vastaus-valinnat label {
    min-height: 3em;
  }

  .vastaus-valinnat label input {
    margin-right: 3.5em;
  }

  .plain-selection label.plain-label {
    background-position-x: 4.5em;  /* .plain-selection padding + .vastaus-valinnat input margin-right */
  }

  .plain-selection label.plain-label input {
    margin-right: 5.5em;  /* .plain-selection padding + .plain-label background-position-x */
  }
  /* /Lisäkokoa mobiilipainikkeille */

  .vastaus-valinnat.compact label:before {
    top: .22em;
  }

  /* matriisi mobiili */
  .piilotettu-tyopoydalla {
    font-size: 14px;
  }
  .teksti-painikkeen-paalla {
    flex-direction: row;
    vertical-align: inherit;
  }
  .taulu-solu {
    display: inherit;
  }
  .taulu-solu > .vastaus-valinnat {
    flex-direction: row;
  }
  .taulu-solu > .vastaus-valinnat.compact {
    flex-direction: row;
    margin: .5em 0;
  }
  .taulu-solu > .vastaus-valinnat label {
    padding: 0;
  }
  .taulu-solu > .vastaus-valinnat div {
    padding: 0 0 0 1em;
  }
  .taulu-solu .vastaus-valinnat.compact label input {
    margin-right: 1.25em;
  }
  /* /matriisi mobiili */
}

@media screen and (max-width: 960px) {
  /* Kysymys, jossa 10 valintanappulaa, asetellaan pystyyn */
  .vastaus-valinnat.nps {
    flex-direction: column;
  }

  .vastaus-valinnat.nps label {
    margin: .5em 0;
  }

  .vastaus-valinnat.nps label {
    padding: 0 0 0 3.5em;
    min-height: 3em;
  }

  .vastaus-valinnat.nps label:before {
    top: .22em;
  }
}

@media screen and (max-width: 350px) {
  .notification-alert {
    min-width: 320px;
  }
  /* Move CSC logo and make room for it */
  footer.disclaimer-footer .app-wrapper {
    background-position: left 10px bottom 85px;
  }
  .copyright {
    margin-top: 9em;
  }
}
