@font-face {
  font-family: 'Lato';
  src: url('../fonts/Lato/Lato-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Poppins';
  src: url('../fonts/Poppins/Poppins-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: light;
}

@font-face {
  font-family: 'Prata';
  src: url('../fonts/Prata/Prata-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;  /* prevents right-side spill */
  font-family: 'Poppins', sans-serif;
  background: #FFFFFF;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

main {
  flex: 1;
  width: 100%;
  height: 100vh;
  margin-bottom: 2rem;
}

/* Wrapper with background pseudo images */
.checker-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 4rem 1rem;
  overflow: hidden;
}

/* Pseudo backgrounds left & right */
.checker-wrapper::before,
.checker-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;              /* take up 30% of viewport each */
  max-width: 900px;        /* but never larger than 900px */
  opacity: 0.45;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.checker-wrapper::before {
  left: 0;
  background-image: url('../images/Checker1.jpg');
}

.checker-wrapper::after {
  right: 0;
  background-image: url('../images/Checker2.jpg');
}

/* Inner content stays centered with breathing room */
.checker-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;           /* keep centered */
  padding: 0 2rem;          /* safe gap padding */
}


/* Form Section */
.checker-form-section {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  width: 100%;
}

.checker-form-section h1 {
  font-family: 'Prata';
  font-size: 2rem;
  margin-bottom: 0.8rem;
  text-align: center;
}

.checker-form-section .description {
  text-align: center;
  margin-bottom: 1rem;
  color: #555;
}

textarea {
  width: 100%;
  min-height: 160px;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  margin-bottom: 1rem;
  resize: vertical;
}

/* Buttons */
.input-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.input-buttons button {
  flex: 1;
  padding: 0.7rem 1rem;
  background: #7a6a60;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.input-buttons button:hover {
  background: #64564e;
}

.input-buttons .secondary {
  background: #e0e0e0;
  color: #333;
}

.input-buttons .secondary:hover {
  background: #cfcfcf;
}

/* Results */
.checker-results {
  margin-top: 1.5rem;
  background: #fafafa;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Common List */
.checker-common {
  width: 100%;
  text-align: center;
}

.checker-common h4 {
  margin: 1rem;
  color: #25394f;
}

#mostCommon {
  list-style: none;
  margin: 1.5rem 0;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 2rem;
  background: #fafafa;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#mostCommon li {
  font-size: 1rem;
  font-weight: 500;
  color: #2c3e50;
  font-style: italic;
}

#result-message {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  text-align: center;
}
#flagged-header {
  margin-top: 1.5rem;
  font-size: 1.2rem;
  color: #c0392b;
  text-align: center;
}
#flagged-ingredients {
  list-style: none;
  margin: 1rem 0;
  padding: 1rem;
  text-align: center;
}

/* Ultra-wide screens (4K scaling) */
@media (min-width: 1900px) {
  .checker-inner {
    max-width: 1200px;
  }
}
/* 1441px–2048px */
@media (max-width: 1600px) and (min-width: 1441px) {
  .checker-wrapper::before,
  .checker-wrapper::after {
    width: 22%;
    max-width: 650px;
    opacity: 0.35;
  }
  .checker-inner {
    max-width: 900px;
  }
}

/* 1025px–1440px */
@media (max-width: 1440px) and (min-width: 1025px) {
  .checker-wrapper::before,
  .checker-wrapper::after {
    width: 20%;
    max-width: 500px;
    opacity: 0.35;
  }
  .checker-inner {
    max-width: 800px;
  }
}

/* 871px–1024px */
@media (max-width: 1024px) and (min-width: 871px) {
  .checker-wrapper::before,
  .checker-wrapper::after {
    width: 18%;
    max-width: 400px;
    opacity: 0.35;
  }
  .checker-inner {
    max-width: 720px;
    padding: 0 1.5rem;
  }
}

/* 768px–870px */
@media (max-width: 870px) and (min-width: 769px) {
  .checker-wrapper::before,
  .checker-wrapper::after {
    width: 160px;
    opacity: 0.35;
  }
  .checker-inner {
    max-width: 100%;
    padding: 0 1rem;
  }
  #mostCommon {
    grid-template-columns: 1fr 1fr;
  }
}

/* ≤768px (mobile layout with top image only) */
@media (max-width: 768px) {
  .checker-wrapper {
    padding-top: 220px; /* leave space for top image */
  }

  .checker-wrapper::before {
    width: 100%;
    height: 200px;
    top: 0;
    left: 0;
    right: 0;
    background-position: top center;
    background-size: cover;
  }

  .checker-wrapper::after {
    display: none;
  }

  .checker-inner {
    max-width: 100%;
    padding: 0 1rem;
  }

  #mostCommon {
    grid-template-columns: 1fr 1fr;
  }
}

/* ≤430px (mobile buttons stacked) */
@media (max-width: 430px) {
  .input-buttons {
    flex-direction: column;
  }
  .input-buttons button {
    width: 100%;
  }
}
/* Screen-reader-only label */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Disclaimer under the checker */
.checker-disclaimer {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #6b6b6b;
}
.checker-disclaimer a {
  color: #7a6a60;
  text-decoration: underline;
}
