/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
  /* overflow: hidden; */
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

body {
  /* 4. Add accessible line-height */
  line-height: 1.5;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* 7. Inherit fonts for form controls */
input, button, textarea, select {
  font: inherit;
}

/* 8. Avoid text overflows */
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

/* 9. Improve line wrapping */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/*
10. Create a root stacking context
*/
#root, #__next {
  isolation: isolate;
}

/* ------------------ reset ^ ----------- */

@font-face {
  font-family: 'SummerFestival';
  src: url('./assets/fonts/SummerFestival.woff2') format('woff2'),
  url('./assets/fonts/SummerFestival.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Super Festival';
  src: url('./assets/fonts/SuperFestival.woff2') format('woff2'),
  url('./assets/fonts/SuperFestival.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --valid-confirm-color: green;
  --invalid-confirm-color: red;
  --light-gray-200: lightgray;
  --light-gray-100: rgb(241, 241, 241);
  --darker-gray-500: rgb(56, 56, 56);
  
  --button-bg-color:rgb(150, 192, 255);
  --button-bg-color-darker:rgb(124, 177, 255);
  
  --border-valid: 1px solid var(--valid-confirm-color);
  --border-invalid: 1px solid var(--invalid-confirm-color);

  --paddin-element: min(2rem, 10%);

  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;

  background: var(--light-gray-100);
}

/* div {
  border: 1px dotted gray;
} */

.container {
  display: flex;
  justify-content: center;
}

.card {
  height: 100vh;
  position: relative;
  background-image: url("./assets/img/bg-img.jpg");
  background-position: center;
  background-size: cover;
}

.card-img {
  position: absolute;
  height: 100%;
  width: 100%;
  z-index: -1;
}

.card-heading {
  position: absolute;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.596);
  color: white;
  top: 8rem;
  text-align: center;
  font-size: clamp(0.6rem, 5vw, 1.2rem);
  font-family: "Super Festival", "SummerFestival";
  display: flex;
  align-items: center;
  padding: min(1rem, 10%);
}

.card-heading {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  padding: 2rem;
  /* border: 2px solid purple; */
}

.card-heading img {
  width: min(80%, 5vw);
}

.card-footer {
  color: var(--light-gray-200);
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translate(-50%); /* centraliza a img com position absolute */
  font-size: clamp(0.5rem, 80%, .7rem);
}

.card-footer a {
  color: white;
}

/* ------- css color validation --------------- */
input[type="text"]:valid,
input[type="password"]:valid,
input[type="email"]:valid,
input[type="tel"]:valid {
  border: var(--border-valid);
}

input[type="text"]:invalid::after,
input[type="password"]:invalid,
input[type="email"]:invalid::after,
input[type="tel"]:invalid::after {
  border: var(--border-invalid);
}

/* ------------- button design ------------ */

.button {
  padding: var(--paddin-element);
}

.button button {
  background-color: var(--button-bg-color);
  color: var(--darker-gray-500);
  border: none;
  border-radius: 4px;
  padding: min(50%, 0.5rem) 3rem;
  margin-bottom: .5rem;
  box-shadow: -2px 3px 10px rgba(0, 0, 0, 0.205);
  cursor: pointer;
  transform: all 250ms ;
}

.button button:hover {
  transform: translateY(1px);
  background-color: var(--button-bg-color-darker);
}

.button a {
  color: var(--button-bg-color-darker);
  text-decoration: none;
  font-weight: bold;
}

/* ----------------- form-row ------------ */

.form-row {
  display: flex;
  flex-flow: column wrap;
}

/* ----------------- form-row header ------------ */

.form-row .form-header {
  margin-top: 5rem;
  padding: var(--paddin-element);
}

.form-header h3:first-child {
  margin-bottom: 2rem;
}

.form-header h3 {
  width: min(66ch, 50vw);
}

/* ----------------- form-row form ------------ */

.form-body .inputs {
  display: flex;
  flex-flow: column;
  justify-content: start;
  align-items: start;
  padding: var(--paddin-element);
  gap: 5px;
  font-size: clamp(0.5rem, 80%, 1rem);
  /* border: 2px solid green; */
  background: white;
  box-shadow: -6px 3px 10px rgba(0, 0, 0, 0.205);
}

.testeCSS p {
  /* border: 2px solid red; */
  display: flex;
  flex-flow: column nowrap;
}

.testeCSS {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  gap: min(.5rem, 1rem);
  align-items: start;
  width: min(80%, 66ch);
  /* border: 2px solid blue; */
}

.testeCSS p label {
  font-weight: 500;
  text-transform: uppercase;
}

/* ----------------- form-row input style ------------ */
input {
  appearance: none;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"] {
  border: 1px solid var(--light-gray-200);
  border-radius: 4px;
  box-shadow: inset 1px 1px 3px #cccccc;
  border-radius: 5px;
}

input::placeholder {
  padding: .2rem;
}

input + span {
  position: relative;
}

input + span::before {
  position: absolute;
  right: -20px;
  top: -20px;
}

input:invalid::after {
  border: 2px solid red;
}

input:invalid + span::before {
  content: "✖";
  color: red;
}

input:valid + span::before {
  content: "✓";
  color: green;
}