/* # Front-end Style Guide

## Layout

The designs were created to the following widths:

- Mobile: 375px
- Desktop: 1440px

*/

:root {
  /* ## Colors */

  /* # Primary */
  --green-200: hsl(148, 38%, 91%);
  --green-600: hsl(169, 82%, 27%);
  --red: hsl(0, 66%, 54%);

  /* # Neutral */
  --white: hsl(0, 0%, 100%);
  --grey-500: hsl(186, 15%, 59%);
  --grey-900: hsl(187, 24%, 22%);
  /* font-weights */
  --font-weight-1: 400;
  --font-weight-2: 700;
}

*,
*::after,
*::before {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-size: 62.5%; /*1rem =10px*/
}
body {
  font-family: "Karla", sans-serif;
  font-size: 1.6rem;
  background: var(--green-200);
  color: var(--grey-900);

  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
}

main {
  flex: 0.2;
  display: grid;
  /* place-items: center; Perfect center */
  /* padding: 3rem 1.5rem; */
}

.container {
  max-width: 700px;
  background: var(--white);
  margin: 3rem auto;
  border-radius: 1.2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  height: auto;
}

section {
  padding: 2rem;
}

h1 {
  margin-bottom: 2rem;
}

.row {
  display: flex;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
  flex: 1;
}
/* Text-based inputs → I-beam cursor */
input[type="text"],
input[type="email"],
textarea {
  cursor: text;
}

/* Radio & checkbox → pointer cursor */
input[type="radio"],
input[type="checkbox"] {
  cursor: pointer;
}

/* Make entire label clickable with pointer */
.radio,
.checkbox label {
  cursor: pointer;
}

/* Submit button */
button {
  cursor: pointer;
}
input,
textarea {
  padding: 1.2rem;
  border-radius: 0.5rem;
  border: 1px solid var(--grey-500);
  font-family: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-600);
}

fieldset {
  border: none;
}

.radio {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.checkbox {
  margin-bottom: 2rem;
}

button {
  background: var(--green-600);
  color: var(--white);
  border: none;
  padding: 1.2rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 1.6rem;
  width: 100%;
}

button:hover {
  opacity: 0.9;
}

.error {
  display: none;
  color: var(--red);
  font-size: 1.2rem;
  margin-top: 0.4rem;
}

#successModal {
  display: none;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--green-200);
  border-radius: 0.8rem;
  text-align: center;
}

.query-type > label {
  border: 0.2rem solid var(--grey-500);
  padding: 1rem;
  margin-top: 0.5rem;
  border-radius: 0.6rem;
  width: 100%;
}

/* ---- Toast Alert ---- */
#toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translate(-50%, -120%);
  background: hsl(169, 82%, 27%);
  color: white;
  padding: 1.2rem 2rem;
  border-radius: 0.6rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.4s ease,
    opacity 0.4s ease;
  opacity: 0;
  z-index: 1000;
}

#toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* ---- Errors ---- */
.error {
  color: hsl(0, 66%, 54%);
  font-size: 1.2rem;
  margin-top: 0.4rem;
  display: none;
}

/* ---- Invalid Field ---- */
.invalid {
  border-color: hsl(0, 66%, 54%);
}

footer {
  padding: 2rem 0;
}

.attribution {
  text-align: center;
  font-size: 1.2rem;
}

/* Mobile */
@media (max-width: 600px) {
  .row {
    flex-direction: column;
  }
}
