:root {
  --Green-400: hsl(172, 67%, 45%) --Teal-color: hsl(185, 42%, 84%);
  --dark-grayscale: hsl(0, 0%, 15%);
  --dark-teal: hsl(183, 100%, 15%);
  --bright-teal: hsl(172, 67%, 45%);
  --light-blue: hsl(203, 50%, 96%);
  --Green-900: hsl(183, 100%, 15%);
  --Grey-500: hsl(186, 14%, 43%);
  --Grey-400: hsl(184, 14%, 56%);
  --Grey-200: hsl(185, 41%, 84%);
  --Grey-50: hsl(189, 47%, 97%);
  --White: hsl(0, 100%, 100%);
  --font-size-form-inputs: 24px;
  --font-family: "Space Mono", monospace;
  --font-weight: 700;
  --font-weight-light: 400;
  --font-weight-bold: 700;
  --font-weight-bolder: 900;
  --font-size-preset-6: 15px;
  --font-size-header: 24px;
  --font-size-preset-7: 14px;
  --font-size-preset-5: 16px;
  --font-size-preset-4: 17px;
  --font-size-preset-3: 18px;
  --font-size-preset-2: 1.7rem;
  --font-size-preset-1: 2.5rem;
  --font-size-preset-0: 3.3rem;
}

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

/* Remove default margin */
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul {
  margin: 0;
  padding: 0;
}
/* Remove list styles on ul, ol elements with a list role, which suggests default styling will be removed */
ul[role="list"],
ol[role="list"] {
  list-style: none;
}
/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}
/* Set core body defaults */
body {
  min-height: 100vh;
  text-rendering: optimizeSpeed;
  line-height: 1.3;
  padding: 0;
}
/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
}
/* Make images easier to work with */
/* img,
picture {
  max-width: 100%;
  display: block;
} */

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

/* Remove all animations, transitions and scroll-behavior for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-family);
  /* background-color: var(--); */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 0.0625rem;
  height: 0.0625rem;
  padding: 0;
  margin: -0.0625rem;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.main-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 2rem;
  width: 100%;
}

.card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--Grey-200);
  width: 100%;
  height: 100%;
  max-height: 150px;
  padding: 5rem;
  position: relative;
  z-index: 1;
}

.card-title {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--Grey-500);
}

.card-header h1 {
  font-size: var(--font-size-header);
  font-weight: var(--font-weight-bold);
  color: var(--Grey-500);
  letter-spacing: 0.5rem;
}

.card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  gap: 2rem;
  background-color: var(--White);
  border-top-left-radius: 1.5rem;
  border-top-right-radius: 1.5rem;
  z-index: 2;
  margin-top: -3.2rem;
  position: relative;
  padding: 1.5rem;
}

.input-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  gap: 0.5rem;
}

.bill-input {
  width: 100%;
  height: 3.3rem;
  padding: 0.5rem;
  font-size: var(--font-size-form-inputs);
  border: none;
  border-radius: 0.5rem;
  background-color: var(--Grey-200);
  text-align: right;
  outline: none;
}

.input-group label {
  color: var(--Grey-500);
  font-size: var(--font-size-preset-5);
  font-weight: var(--font-weight-bold);
}

.input-group input {
  width: 100%;
  height: 3.3rem;
  padding: 0.5rem;
  font-size: var(--font-size-form-inputs);
  border: none;
  border-radius: 0.5rem;
  background-color: var(--Grey-200);
}

.tip-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  gap: 0.5rem;
  font-weight: var(--font-weight-bold);
}

.tip-section p {
  color: var(--Grey-500);
  font-size: var(--font-size-preset-5);
  font-weight: var(--font-weight-bold);
}

.tip-options {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.number-of-people {
  width: 100%;
  height: 3.3rem;
  padding: 0.5rem;
  font-size: var(--font-size-form-inputs);
  border: none;
  border-radius: 0.5rem;
  background-color: var(--Grey-200);
  text-align: right;
  outline: none;
}

#error-msg {
  color: #d38f7a;
  font-size: 14px;
  font-weight: 700;
}

.error-hide {
  display: none;
}

.error-show {
  display: block;
  text-align: right;
}

.tip-option {
  width: 9.8rem;
  height: 3.3rem;
  background-color: var(--Green-900);
  border: none;
  border-radius: 0.5rem;
  font-size: var(--font-size-form-inputs);
  color: var(--White);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
}

.tip-option:hover {
  background-color: var(--bright-teal);
  color: var(--Green-900);
}

.tip-option.active {
  background-color: var(--bright-teal);
  color: var(--Green-900);
}

.tip-options input {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 9.8rem;
  height: 3.3rem;
  border: none;
  border-radius: 0.5rem;
  padding: 1rem;
  font-size: var(--font-size-form-inputs);
  background-color: var(--Grey-200);
  color: var(--Grey-400);
  text-align: center;
}

.bottom-card {
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
  padding: 1.5rem;
  background-color: var(--Green-900);
  border-bottom-left-radius: 1.5rem;
  border-bottom-right-radius: 1.5rem;
  border-radius: 0.5rem;
  gap: 2rem;
}

.reset {
  width: 100%;
  height: 3.3rem;
  background-color: var(--bright-teal);
  border: none;
  border-radius: 0.5rem;
  font-size: var(--font-size-form-inputs);
  color: var(--Green-900);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  padding: 0.5rem;
}

.reset:hover {
  background-color: var(--Grey-200);
}

.reset:active {
  background-color: var(--Grey-200);
}

.price-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 3.3rem;
  padding: 1rem;
  border: none;
  border-radius: 0.5rem;
  background-color: var(--Grey-200);
  color: var(--Grey-500);
  font-size: var(--font-size-form-inputs);
  font-weight: var(--font-weight-bold);
  transition: outline 0.1s;
}

.price-box:focus-within {
  outline: 2px solid #26c0ab;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.amount-person {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  height: 3.3rem;
  border: none;
  border-radius: 0.5rem;
  color: var(--White);
  font-size: var(--font-size-preset-5);
  width: 100%;
  gap: 4rem;
}

.total-tip-amount {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
}

.person {
  color: var(--Grey-500);
}

.amount-value {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0.1rem;
}

.amount-value img {
  width: 1.3rem;
  height: 1.3rem;
}

.tip-amount-total {
  color: var(--bright-teal);
  font-size: var(--font-size-preset-1);
  font-weight: var(--font-weight-bold);
}

.dollar-sign {
  color: var(--bright-teal);
  font-size: var(--font-size-preset-2);
  font-weight: var(--font-weight-bold);
}

.total {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  height: 3.3rem;
  border: none;
  border-radius: 0.5rem;
  color: var(--White);
  font-size: var(--font-size-preset-5);
  width: 100%;
  gap: 6rem;
}

.total-amount-value {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: start;
}

.visually-hidden {
  display: none;
}

@media screen and (min-width: 768px) {
  body {
    font-family: var(--font-family);
    background-color: var(--Grey-200);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .card-body-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
  }

  .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    max-width: 608px;
    gap: 2rem;
    background-color: var(--White);
    border-radius: 1.5rem;
    position: relative;
    padding: 3.5rem;
  }

  .tip-options {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
  .tip-option.active {
    background-color: var(--bright-teal);
    color: var(--Green-900);
  }
}

@media screen and (min-width: 1024px) {
  .card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Three rows for the three left-side sections */
    grid-template-rows: auto auto auto; /* 3 rows for Bill, Tip, and People */
    gap: 32px;
    padding: 42px;
    background-color: white;
    border-radius: 25px;
    width: 100%;
    max-width: 920px;
  }

  .bottom-card {
    grid-column: 2;
    grid-row: 1/4;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Keeps the RESET button at the bottom */
  }

  .price-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 3.3rem;
    padding: 1rem;
    border: none;
    border-radius: 0.5rem;
    background-color: var(--Grey-200);
    color: var(--Grey-500);
    font-size: var(--font-size-form-inputs);
    font-weight: var(--font-weight-bold);
  }

  .tip-option {
    grid-template-columns: repeat(3, 1fr);
    width: 7.5rem;
    height: 3.3rem;
  }
  .custom-tip-class {
    width: 100%;
    border: none;
    background-color: #f3f9fa;
    text-align: right;
    padding: 0 15px;
    font-family: inherit;
    font-weight: 700;
    color: #00474b;
    border-radius: 5px;
    outline: none;
  }
  .tip-option.active {
    background-color: var(--bright-teal);
    color: var(--Green-900);
  }

  .tip-options input {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 7.5rem;
    height: 3.3rem;
    border: none;
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: var(--font-size-form-inputs);
    background-color: var(--Grey-200);
    color: var(--Grey-400);
    text-align: center;
  }

  .reset {
    margin-top: auto;
    width: 100%;
    background-color: #26c0ab;
    border: none;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
  }

  .card-header h1 {
    font-size: var(--font-size-header);
    font-weight: var(--font-weight-bold);
    color: var(--Grey-500);
    letter-spacing: 0.5rem;
    margin-bottom: 6.5rem;
  }

  .tip-amount {
    font-size: var(--font-size-preset-3);
    font-weight: var(--font-weight-bold);
  }

  .person {
    font-size: var(--font-size-preset-4);
    font-weight: var(--font-weight-bold);
  }

  .tip-amount-total {
    font-size: var(--font-size-preset-0);
    font-weight: var(--font-weight-bold);
  }

  .dollar-sign {
    font-size: var(--font-size-preset-1);
    font-weight: var(--font-weight-bold);
  }

  .number-of-people {
    font-size: var(--font-size-preset-2);
    font-weight: var(--font-weight-bold);
  }
}
