/* CSS RESETS */

/* Box sizing rules */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin in favour of better control in authored CSS */
body, h1, h2, h3, h4, p,
figure, blockquote, dl, dd {
  margin-block-end: 0;
}

/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul, ol {
  list-style: none;
}

/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4,
button, input, label {
  line-height: 1.75;
}

/* Balance text wrapping on headings */
h1, h2,
h3, h4 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture {
  max-width: 100%;
  display: block;
}

/* Inherit fonts for inputs and buttons */
input, button,
textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* FOR SCREEN READERS ONLY */

.visually-hidden:not(:focus):not(:active) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0); /* Legacy property for Internet Explorer */
  clip-path: inset(50%);
  white-space: nowrap;
}

/* FONTS */

/* poppins-regular - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  src: url('../fonts/poppins-v24-latin-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-500 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/poppins-v24-latin-500.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-500italic - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Poppins';
  font-style: italic;
  font-weight: 500;
  src: url('../fonts/poppins-v24-latin-500italic.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-600 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/poppins-v24-latin-600.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}
/* poppins-700 - latin */
@font-face {
  font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/poppins-v24-latin-700.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* CUSTOM VARIABLES */

:root {

    /* COLORS */

    --clr-white: hsl(0, 100%, 100%);
    --clr-black: hsl(0, 0%, 0%);
    --clr-gray-900: hsl(249, 10%, 26%);
    --clr-gray-200: hsl(0, 0%, 87%);
    --clr-purple-700: hsl(248, 32%, 49%);
    --clr-purple-400: hsl(247, 32%, 72%);
    --clr-purple-350: hsl(246, 25%, 77%);
    --clr-green-400: hsl(154, 59%, 51%);
    --clr-green-300: hsl(154, 65%, 68%);
    --clr-red-400: hsl(0, 100%, 74%);

    /* TYPOGRAPHY */

    --ff-main: "Poppins", sans-serif;
    --fs-body: 1rem;

    /* SPACINGS */

    --space-0: 0rem;
    --space-100: 0.5rem;
    --space-200: 1rem;
    --space-300: 1.5rem;
    --space-400: 2rem;
    --space-500: 2.5rem;
    --space-600: 3rem;
    --space-800: 4rem;

    /* BORDER RADIUS */

    --rounded-sm: 0.625rem;
    --rounded-xs: 0.313rem;

}

body {
    font-family: var(--ff-main);
    font-size: var(--fs-body);
    font-weight: 500;
    line-height: 1.65;
    color: var(--clr-white);
    background-image: url("../images/bg-intro-mobile.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-color: var(--clr-red-400);
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding-inline: var(--space-300);
    padding-block-start: clamp(5.5rem, 3.1429rem + 4.9107vw, 7.5625rem);
    padding-block-end: clamp(4.25rem, 3.0836rem + 4.9765vw, 7.5625rem);
    text-align: center;
}

.main {
  display: grid;
  gap: clamp(var(--space-800), 5.1429rem + -2.381vw, var(--space-600));
  max-inline-size: 33.75rem;
}

.header__title {
  font-size: clamp(1.75rem, 0.438rem + 5.598vw, 3.125rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: clamp(-0.0107em, -0.0068rem + -0.0509vw, -0.01em);
  margin-block-end: var(--space-200);
}

.form-offer {
  font-size: 0.938rem;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.0166em;
  background-color: var(--clr-purple-700);
  border-radius: var(--rounded-sm);
  padding-block: 1.125rem;
  padding-inline: 4.25rem;
  box-shadow: 0px 8px rgba(0, 0, 0, 0.1469);
  margin-block-end: var(--space-300);
}

.form {
  background-color: var(--clr-white);
  border-radius: var(--rounded-sm);
  box-shadow: 0px 8px rgba(0, 0, 0, 0.1469);
  display: flex;
  flex-direction: column;
  gap: clamp(var(--space-200), 0.5229rem + 2.0356vw, var(--space-300));
  padding-block: clamp(var(--space-300), 1.0229rem + 2.0356vw, var(--space-400));
  padding-inline: clamp(var(--space-300), 0.5458rem + 4.0712vw, var(--space-500));
}

.form__group {
  position: relative;
  width: 100%;
}

.form__field {
  color: var(--clr-gray-900);
  caret-color: var(--clr-purple-700);
  font-size: 0.938rem;
  letter-spacing: 0.0166em;
  border: 1px solid var(--clr-gray-200);
  border-radius: var(--rounded-xs);
  outline-width: 2px; 
  outline-color: var(--clr-purple-700);
  width: 100%;
  padding-block: var(--space-200);
  padding-inline: clamp(var(--space-300), 1.0229rem + 2.0356vw, var(--space-400));
}

.form__group--error .form__field:invalid {
  border: 2px solid var(--clr-red-400);
  color: var(--clr-red-400);
  margin-block-end: var(--space-100);
}

.form__group--error .form__error {
  display: block;
  color: var(--clr-red-400);
  font-size: 0.688rem;
  font-style: italic;
  line-height: 1.55;
  text-align: end;
}

.form__group--error::after {
  content: "";
  background-image: url("../images/icon-error.svg");
  background-size: contain;
  background-repeat: no-repeat;
  position: absolute;
  top: 50%;
  right: clamp(var(--space-300), 1.0229rem + 2.0356vw, var(--space-400));
  transform: translateY(-104%);
  width: 1.5rem;
  height: 1.5rem;
}

.form__submit {
  font-size: 0.938rem;
  font-weight: 600;
  letter-spacing: 0.1333em;
  text-transform: uppercase;
  color: var(--clr-white);
  background-color: var(--clr-green-400);
  border: 1px solid var(--clr-green-400);
  border-radius: var(--rounded-xs);
  box-shadow: inset 0px -4px rgba(0, 0, 0, 0.0909);
  cursor: pointer;
  padding-block: var(--space-200);
  margin-block-end: var(--space-100);
  width: 100%;
  transition: background-color 200ms;
}

.form__submit:hover {
  background-color: var(--clr-green-300);
}

.form__disclaimer {
  font-size: 0.688rem;
  line-height: 1.9;
  color: var(--clr-purple-350);
}

.form__disclaimer--strong {
  color: var(--clr-red-400);
}

@media screen and (min-width: 48em) {
    body {
        background-image: url("../images/bg-intro-desktop.png");
    }

    .header__title {
      line-height: 1.3;
    }
}

@media screen and (min-width: 90em) {

  .main {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    max-inline-size: 69.563rem;
  }

  .header {
    position: relative;
    top: -2.5rem;
    text-align: start;
  }
}