@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap');

/* Base colors*/
:root {
  --primary-color: #006064;
  --background-color: whitesmoke;
  /*--background-color: rgba(255, 248, 225, 0.5);*/
  --accent-color: #00796B;
  --selected-bg-color: #B2DFDB;
  --white-color: white;
  --error-color: #D32F2F;
  --focus-outline-color: #00796B;
  --focus-outline: 2px solid var(--accent-color);
  --text-color: #006064;
  --border-color: #00796B;
  --transition-speed: 0.3s;
}


/* Box-sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}


/* Base styles */
body {
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  color: var(--primary-color);
  background-color: var(--background-color);
  font-size: 16px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Base sizes */
h1 {
  font-size: 1.5rem;
  /* 24px */
}

h2 {
  font-size: 1.25rem;
  /* 20px */
}

h3 {
  font-size: 1.125rem;
  /* 18px */
}

p,
legend,
label {
  font-size: 1rem;
  /* 16px */
}

nav a {
  font-size: 1.125rem;
  /* 18px  */
}

/* Skip link  */
.skip-link {
  position: absolute;
  top: -2.5rem;
  left: 0;
  background: var(--accent-color);
  color: var(--white-color);
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
  outline: var(--focus-outline);
  outline-offset: 2px;
}

:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Header */
#header {
  width: 100vw;
  background: #2C3E50;
  color: var(--white-color);
  padding: 2rem 0;

}

#header .header-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 3rem;
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: space-between;
}

#header h1 {
  color: var(--white-color);
  margin: 0;
}

#header nav ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: flex;
  gap: 2rem;
}

#header nav a {
  color: var(--white-color);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 6px;
  transition: opacity var(--transition-speed);
}

#header nav a:hover {
  text-decoration: underline;
}

/* Quiz instructions*/
#accessibility-quiz {
  margin: 5% 20%;
  border-radius: 8px;
  background-color: var(--background-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  width: 100%;
}

#accessibility-quiz h2 {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.quiz-instructions {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--white-color);
  color: var(--text-color);
  margin: 1rem auto;
  max-width: 600px;
  width: 100%;
  padding: 1rem;
  border-radius: 0 4px 4px 0;
}

.info-image {
  background: var(--white-color);
  padding: 1rem;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/*Quiz card*/
.quiz-card {
  display: none;
}

.quiz-card.active {
  display: block;
  margin: 1rem auto;
  width: 100%;
  max-width: 600px;
  text-align: left;
}

fieldset {
  border: none;
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 4px;
}

legend {
  font-weight: bold;
  text-align: left;
  margin-bottom: 1rem;
  color: var(--text-color);
  border-radius: 4px;
}

input {
  text-align: left;
}

input[type="radio"] {
  cursor: pointer;
  accent-color: var(--primary-color);
  width: 1.1rem;
  height: 1.1rem;
  vertical-align: top;
  margin-top: 5px;
}

label {
  padding-left: 8px;
  margin-bottom: 8px;
  width: 85%;
}

input[type="radio"]+label {
  display: inline-block;
  word-wrap: break-word;
}

input[type="radio"]:hover {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/*Style for navigation w. keyboard*/
input[type="radio"]:checked+label {
  background-color: var(--selected-bg-color);
  border-radius: 4px;
}

input[type="radio"]:focus-visible+label {
  outline: var(--focus-outline);
  border-radius: 4px;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2em;
}

.nav-buttons button {
  background-color: var(--primary-color);
  color: var(--white-color);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 1em;
  width: 6em;
  cursor: pointer;
}

.nav-buttons button:hover {
  background-color: var(--accent-color);
  border: 2px solid var(--primary-color)
}

.next-btn:active,
.prev-btn:active {
  transform: scale(0.98);
}

.next-btn:focus-visible,
.prev-btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/*Summary card*/
#summary-card h2 {
  text-align: center;
  margin: 0 auto 0.75rem auto;
}

#summary-content h3 {
  text-align: center;
  word-wrap: break-word;
  margin: 1rem auto 0.5rem auto;
}

#summary-card p {
  text-align: center;
  margin: 0 auto 0.5rem auto;
}


/* Progress bar */
.quiz-progress {
  margin: 2rem 0;
}

.progress-bar {
  background-color: var(--selected-bg-color);
  border-radius: 8px;
  height: 20px;
  margin: 0 2rem 0 2rem;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background-color: var(--primary-color);
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 8px;
}

.progress-text {
  margin-top: 0.5rem;
  text-align: center !important;
  font-weight: 500;
}

.error-message {
  color: var(--error-color);
  font-size: 1rem;
  font-weight: 600;
  padding-left: 0.5rem;
}

.error-container {
  margin-top: 2rem;
}

#restart-btn {
  background-color: var(--primary-color);
  color: var(--white-color);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 1rem;
  width: 8rem;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  margin-top: 2rem;
}

#restart-btn:hover {
  background-color: var(--accent-color);
  border: 2px solid var(--primary-color)
}

#restart-btn:active {
  transform: scale(0.98);
}

#restart-btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* About page*/
.noinfo-image {
  width: 100%;
  aspect-ratio: 2.48 / 1;
  /*to better cls*/
  object-fit: cover;
}

#introduction {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding-left: 10px;
  padding-right: 10px;
  min-height: 300px;
  /*for better cls*/

}

#introduction h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

#introduction p {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: left;
  padding: 0.5rem;
}

/* Footer */
.footer-content {
  width: 100vw;
  background-color: #2C3E50;
  color: var(--white-color);
  padding: 2rem 0;
  margin-top: 2rem;
}

footer nav ul {
  list-style: none;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  display: flex;
  gap: 5rem;
  justify-content: center;
  background-color: #2C3E50;
  
}

nav a {
  color: var(--white-color);
  text-decoration: none;
}

nav a:hover {
  text-decoration: underline;
}

/*Media Queries*/
@media (min-width: 320px) and (max-width: 480px) {

  #header .header-content {
    flex-direction: column;
  }
}

/* 480px to 768px */
@media (min-width: 481px) and (max-width: 768px) {
  #header .header-content {
    flex-direction: column;
  }

  #header h1 {
    font-size: 1.625rem;
    /* 26px */
  }

  #header nav a,
  footer nav a {
    font-size: 1.25rem;
    /* 20px */
  }

  .quiz-instructions {
    width: 90%;
  }

  h2 {
    font-size: 1.375rem;
    /* 22px */
  }

  p,
  legend,
  label {
    font-size: 1.125rem;
    /* 18px */
  }

  .nav-buttons button {
    width: 7.5rem;
  }

  #restart-btn {
    width: 9rem;
  }
}

/* 768px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {

  #header h1 {
    font-size: 1.625rem;
    /* 26px */
  }

  #header nav a,
  footer nav a {
    font-size: 1.375rem;
    /* 22px */
  }

  .quiz-instructions {
    padding: 2em;
  }

  .quiz-instructions p {
    text-align: left;
  }

  h2 {
    font-size: 1.375rem;
    /* 22px */
  }

  p,
  legend,
  label {
    font-size: 1.125rem;
    /* 18px */
  }

  .quiz-card.active p {
    text-align: left;
  }

  .nav-buttons button {
    width: 7.5rem;
  }

  #restart-btn {
    width: 9rem;
  }

  #summary-content {
    padding-left: 4rem;
  }

  #summary-card h2 {
    padding-left: 4rem;
  }

  #summary-card h2,
  #summary-content h3,
  #summary-content p {
    text-align: left;
  }

  #instruction p {
    text-align: left;
  }

  footer nav ul {
    justify-content: flex-end;
    gap: 4rem;
    padding-right: 5rem;
  }
}

@media (min-width: 1025px) {
  #header h1 {
    font-size: 1.75rem;
    /* 28px */
  }

  #header nav a,
  footer nav a {
    font-size: 1.375rem;
    /* 22px */
  }

  .quiz-instructions {
    padding: 2rem;

  }

  .quiz-instructions p {
    text-align: left;
  }

  h2 {
    font-size: 1.5rem;
    /* 24px */
  }

  p,
  legend,
  label {
    font-size: 1.25rem;
    /* 20px */
  }

  .nav-buttons button {
    width: 7.5rem;
  }

  #restart-btn {
    width: 9rem;
  }

  #summary-content {
    padding-left: 4rem;
  }

  #summary-card h2 {
    padding-left: 4rem;
  }

  #summary-card h2,
  #summary-content h3,
  #summary-content p {
    text-align: left;
  }

  #instruction p {
    text-align: left;
  }

  footer nav ul {
    justify-content: flex-end;
    gap: 4rem;
    padding-right: 5rem;
  }

}