/* ---------------- */
/* --- Globals ---- */
/* ---------------- */
:root {
  /* Colors */
  --color-bg-intro: hsl(217, 28%, 15%);
  --color-bg-main: hsl(218, 28%, 13%);
  --color-bg-footer: hsl(216, 53%, 9%);
  --color-bg-testimonials: hsl(219, 30%, 18%);
  
  --color-accent-cyan: hsl(176, 68%, 64%);
  --color-accent-blue: hsl(198, 60%, 50%);
  --color-error-red: hsl(0, 100%, 63%);
  
  --color-white: hsl(0, 0%, 100%);
  
  /* Fonts */
  --font-heading: 'Raleway', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

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

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-white);
  background-color: var(--color-bg-main);
  text-align: center;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 1.5rem; } /* 24px */
h2 { font-size: 1.125rem; } /* 18px */
h3 { font-size: 1.125rem; }

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

img {
  max-width: 100%;
  height: auto;
}

/* -------------------- */
/* --- Utility Classes -- */
/* -------------------- */
.container {
  width: 90%;
  max-width: 1240px;
  margin: 0 auto;
}

.button {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem; /* 14px */
  padding: 1rem 2rem;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.button--gradient {
  background: linear-gradient(to right, var(--color-accent-cyan), var(--color-accent-blue));
  color: var(--color-white);
}

.button--gradient:hover {
  /* From active-states.jpg */
  background: var(--color-accent-cyan);
}

/* ---------------- */
/* --- Header ----- */
/* ---------------- */
.header {
  background-color: var(--color-bg-intro);
  padding: 1.5rem 0;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  width: 100px;
  height: auto;
}

.header__nav {
  display: flex;
  gap: 1rem;
}

.header__nav a {
  font-family: var(--font-heading);
  font-size: 0.875rem;
}

.header__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}


/* ---------------- */
/* --- Hero ------- */
/* ---------------- */
.hero {
  background-color: var(--color-bg-intro);
  background-image: url('./images/bg-curvy-mobile.svg');
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% auto;
  padding: 2rem 0 10rem;
}

.hero__image {
  max-width: 400px;
  margin: 0 auto 2rem;
}

.hero__title {
  margin-bottom: 1.5rem;
  max-width: 30ch;
  margin-left: auto;
  margin-right: auto;
}

.hero__description {
  margin-bottom: 2rem;
  max-width: 45ch;
  margin-left: auto;
  margin-right: auto;
  padding: 0 0.5rem;
}

.hero .button {
  min-width: 240px;
}

/* ---------------- */
/* --- Features --- */
/* ---------------- */
.features {
  background-color: var(--color-bg-main);
  padding: 0 0 6rem;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}

.feature-item {
  max-width: 400px;
  margin: 0 auto;
}

.feature-item__icon {
  height: 60px;
  margin: 0 auto 1.5rem;
}

.feature-item__title {
  margin-bottom: 0.5rem;
}

/* ---------------- */
/* --- Productive - */
/* ---------------- */
.productive {
  padding: 6rem 0;
}

.productive__image {
  max-width: 400px;
  margin: 0 auto 3rem;
}

.productive__text {
  text-align: left;
  max-width: 50ch;
  margin: 0 auto;
}

.productive__title {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.productive__text p {
  margin-bottom: 1rem;
}

.productive__link {
  color: var(--color-accent-cyan);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-accent-cyan);
  padding-bottom: 0.25rem;
}

.productive__link:hover {
  color: var(--color-white);
  border-bottom-color: var(--color-white);
}

.productive__link img {
  transition: transform 0.3s ease;
}

.productive__link:hover img {
  transform: translateX(5px);
}

/* ---------------- */
/* -- Testimonials  */
/* ---------------- */
.testimonials {
  padding: 6rem 0;
}

.testimonials .container {
  position: relative;
}

.testimonials__quotes {
  position: absolute;
  top: -20px;
  left: 5px;
  width: 30px;
  z-index: -1;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  text-align: left;
}

.testimonial-card {
  background-color: var(--color-bg-testimonials);
  padding: 1.5rem;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.testimonial-card p {
  font-size: 0.75rem; /* 12px */
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile__image {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.profile__info h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.profile__info span {
  font-size: 0.625rem; /* 10px */
}

/* ---------------- */
/* --- Footer ----- */
/* ---------------- */
.site-footer {
  background-color: var(--color-bg-footer);
  padding-top: 15rem; /* Make space for CTA */
  padding-bottom: 4rem;
  position: relative;
  text-align: left;
}

/* --- CTA Box --- */
.cta {
  position: absolute;
  top: -100px; /* Pull up */
  left: 0;
  right: 0;
  z-index: 10;
}

.cta .container {
  background-color: var(--color-bg-testimonials);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  max-width: 860px;
}

.cta h2 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.cta p {
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.cta-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.form-control input {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--color-white);
  border-radius: 100px;
  font-family: var(--font-body);
  color: var(--color-bg-main);
}

.form-control .error-message {
  display: none;
  font-size: 0.75rem;
  color: var(--color-error-red);
  padding-left: 1rem;
  margin-top: 0.5rem;
  text-align: left;
}

/* JS States */
.cta-form.is-invalid .error-message {
  display: block;
}
.cta-form.is-invalid input {
  border-color: var(--color-error-red);
}


/* --- Footer Content --- */
.footer-content {
  padding-top: 2.5rem;
}

.footer-logo {
  margin-bottom: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-contact div {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

/* --- THIS IS THE FIX --- */
.footer-contact img {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  flex-shrink: 0; /* Prevents icon from shrinking */
}
/* --- END OF FIX --- */

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-nav a:hover {
  font-weight: 700;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.footer-socials a {
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-white);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.875rem;
}

.footer-socials a:hover {
  color: var(--color-accent-cyan);
  border-color: var(--color-accent-cyan);
}

/* ------------------------- */
/* --- Desktop Styles ------ */
/* ------------------------- */
@media (min-width: 900px) {
  body {
    text-align: left;
  }
  
  h1 { font-size: 2.5rem; } /* 40px */
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.25rem; } /* 20px */

  .logo {
    width: 160px;
  }
  
  .header__nav {
    gap: 3.5rem;
  }
  
  .header__nav a {
    font-size: 1rem;
  }

  /* --- Hero (Desktop) --- */
  .hero {
    background-image: url('./images/bg-curvy-desktop.svg');
    padding: 4rem 0 16rem;
  }
  
  .hero__image {
    max-width: 720px;
  }
  
  .hero__title {
    max-width: 35ch;
  }
  
  .hero__description {
    font-size: 1.125rem;
    max-width: 55ch;
  }
  
  .hero .button {
    min-width: 280px;
  }
  
  /* --- Features (Desktop) --- */
  .features-grid {
    grid-template-columns: 1fr 1fr;
    gap: 6rem 4rem;
  }
  
  /* --- Productive (Desktop) --- */
  .productive .container {
    display: flex;
    align-items: center;
    gap: 3.5rem;
  }
  
  .productive__image {
    max-width: 600px;
    flex: 1;
    margin-bottom: 0;
  }
  
  .productive__text {
    flex: 1;
    margin: 0;
  }
  
  .productive__title {
    font-size: 2.5rem;
  }

  /* --- Testimonials (Desktop) --- */
  .testimonials {
    padding-bottom: 12rem; /* Make space for CTA */
  }

  .testimonials__quotes {
    top: -35px;
    left: -10px;
    width: 55px;
  }

  .testimonial-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .testimonial-card {
    padding: 2rem;
  }
  
  .testimonial-card p {
    font-size: 0.875rem;
  }

  /* --- CTA (Desktop) --- */
  .cta {
    top: -140px; /* Pull up more */
  }

  .cta .container {
    padding: 3rem;
  }

  .cta h2 {
    font-size: 2rem;
  }
  
  .cta p {
    font-size: 1rem;
    max-width: 100%;
  }

  .cta-form {
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
  }

  .form-control {
    position: relative;
  }

  .form-control .error-message {
    position: absolute;
    bottom: -25px; /* Position error below input */
  }
  
  .cta-form .button {
    width: 200px;
    justify-self: end;
  }
  
  /* --- Footer (Desktop) --- */
  .site-footer {
    padding-top: 10rem;
  }

  .footer-grid {
    grid-template-columns: 3fr 2fr 1fr 1fr 1fr;
    gap: 2rem;
    align-items: flex-start;
  }
  
  .footer-nav {
    margin-top: 0;
  }
  
  .footer-socials {
    flex-direction: row;
    justify-content: flex-start;
    margin-top: 0;
  }
}
