/* font */
@import url("https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500;700&display=swap");

:root {
  --marine-blue: hsl(213, 96%, 18%);
  --purplish-blue: hsl(243, 100%, 62%);
  --pastel-blue: hsl(228, 100%, 84%);
  --light-blue: hsl(206, 94%, 87%);
  --strawberry-red: hsl(354, 84%, 57%);
  --cool-gray: hsl(231, 11%, 63%);
  --light-gray: hsl(229, 24%, 87%);
  --magnolia: hsl(217, 100%, 97%);
  --alabaster: hsl(231, 100%, 99%);
  --white: hsl(0, 0%, 100%);
  --ff-family: "Ubuntu", sans-serif;
  --ff-sm: 400;
  --ff-md: 500;
  --ff-lg: 700;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* reset */

html {
  text-rendering: optimizeSpeed;
  scroll-behavior: smooth;
}

.no-spinners::-webkit-inner-spin-button,
.no-spinners::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

img {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* main style */

body {
  font-family: var(--ff-family);
  background-color: var(--light-gray);
  display: grid;
  place-content: center;
  min-height: 100vh;
  font-size: 16px;
  overflow: hidden;
}

main {
  min-height: 450px;
  margin: 0 auto;
  background-color: var(--white);
  padding: 1em 1em 1em 0.8em;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 5em;
  border-radius: 10px;
  position: relative;
}

/* SIDEBAR */

#sidebar {
  background-image: url(./assets/images/bg-sidebar-desktop.svg);
  padding: 2em;
  height: 550px;
  background-size: 100%;
  background-repeat: no-repeat;
  width: 275px;
  color: var(--white);
  text-transform: uppercase;
  border-radius: 7px;
}

#sidebar div {
  display: flex;
}

.btn {
  width: 2em;
  height: 2em;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  border: 1px solid white;
  margin-bottom: 2em;
  transition: 0.5s all;
}

#sidebar .btn:hover {
  cursor: pointer;
}

.btn-info {
  flex-direction: column;
  margin-left: 0.6em;
}

#sidebar span {
  color: var(--cool-gray);
  font-size: 0.8em;
  display: block;
}

#sidebar p {
  font-weight: var(--ff-md);
  font-size: 0.875em;
  padding-top: 3px;
}

.active {
  border-color: unset;
  background-color: var(--light-blue);
  color: var(--marine-blue);
  border: none;
  font-weight: var(--ff-lg);
}

#form {
  position: relative;
}

form {
  position: relative;
}

/* General Page */

.page {
  margin-top: 2em;
  color: var(--marine-blue);
  margin-right: 3em;
}

.page h1 {
  font-weight: var(--ff-lg);
  font-size: 2em;
  margin-bottom: 10px;
}

.page p {
  color: var(--cool-gray);
  margin-bottom: 2.5em;
  font-size: 0.9em;
}

/* PERSONAL INF0 */

/* Form Input */
.personal-info label {
  display: block;
  margin-bottom: 1.2em;
  font-weight: var(--ff-md);
}

.personal-info input {
  height: 3em;
  width: 100%;
  margin-top: 8px;
  border-radius: 7px;
  padding-left: 0.8em;
  border: 1px solid var(--light-gray);
  outline: none;
  font-weight: var(--ff-lg);
}

.personal-info ::placeholder {
  font-weight: var(--ff-md);
  color: var(--cool-gray);
}

label span {
  display: flex;
  justify-content: space-between;
}

label span.err-msg {
  color: var(--strawberry-red);
  opacity: 0;
}

input:is(:active, :hover) {
  border: 2px solid var(--purplish-blue);
  cursor: pointer;
}

label.error input {
  border: 2px solid var(--strawberry-red);
}

label.error .err-msg {
  opacity: 100;
}

/* SECOND PAGE  || Plan section */

#plans {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1em;
}

.plan {
  border: 1px solid var(--light-gray);
  padding: 1em 2em 1em 1em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 180px;
  border-radius: 10px;
}

label.plan:hover {
  border: 2px solid var(--purplish-blue);
  cursor: pointer;
}

label.plan div {

  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan img {
  width: 40px;
}

.plan p {
  margin: unset;
  color: var(--marine-blue);
  font-weight: var(--ff-md);
  font-size: 1.2rem;
}

.plan span {
  color: var(--cool-gray);
  font-size: 0.8rem;
}

input[type="radio"]:checked~label {
  background-color: var(--magnolia);
  border: 2px solid var(--purplish-blue);
}

span.free {
  color: var(--marine-blue)
}

.period {
  display: flex;
  flex-direction: row;
  justify-content: center;
  background-color: var(--magnolia);
  padding: 15px 0;
  max-height: 45px;
  border-radius: 10px;
  margin-top: 2em;
  align-items: center;
}

.period p {
  font-size: 0.8rem;
  margin: 3px 30px;
}

.period p.active-plan {
  color: var(--marine-blue);
  font-weight: var(--ff-lg);
}

.toggle {
  height: 22px;
  padding: 2px;
  width: 40px;
  border-radius: 1em;
  background: var(--marine-blue);
}

.slider {
  width: 18px;
  height: 18px;
  background-color: var(--white);
  border-radius: 50%;
  transition: 0.5s ease;
}

.slider-active {
  transform: translateX(100%);
}

/* ADD ONS SECTION */
.add-ons {
  display: flex;
  flex-direction: column;
  gap: 1em;
}

.add-ons label {
  padding: 20px;
  border: 1px solid var(--light-gray);
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px;
}

.add-ons label:has(input:checked) {
  background-color: var(--magnolia);
  border: 1px solid var(--marine-blue);
}

.add-ons input[type="checkbox"] {
  border: unset;
  width: 20px;
  margin: unset;
  margin-right: 20px;
  accent-color: var(--purplish-blue);
}

.add-ons label:hover {
  border: 1px solid var(--purplish-blue);
  cursor: pointer;
}

.add-ons p {
  margin-bottom: 5px;
}

.add-ons-type {
  display: flex;
  flex-direction: row;
}

.add-ons-type p {
  color: var(--marine-blue);
  font-weight: var(--ff-lg);
}

.add-ons-type span {
  color: var(--cool-gray);
  font-weight: var(--ff-sm);
}

.add-ons-price {
  color: var(--purplish-blue);
}

/* Checkout */
.addOns-picked {
  display: flex;
  flex-direction: column;
  gap: 2em;
}

.addOns-type {
  display: inherit;
  justify-content: space-between;
}

.addOn-type {
  color: var(--cool-gray);
}

/* SUMMARY SECTION */

#summary {
  background-color: var(--magnolia);
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 10px;
}

.plan-summary-details {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  font-weight: var(--ff-lg);
}

.change-plan {
  padding-top: 5px;
  color: var(--light-gray);
  text-decoration: underline;
  font-size: 15px;
  font-weight: var(--ff-sm);
}

.change-plan:hover {
  cursor: pointer;
  color: var(--purplish-blue);
  font-weight: var(--ff-md);
}

#summary hr {
  margin: 30px 0;
  border: solid 1px var(--light-gray);
}

.summary-info {
  text-align: center;
}

.summary-info img {
  margin: 180px auto 20px;
  width: 80px;
}

.summary-info p {
  margin: 16px auto 0;
  width: 400px;
}

.total-price {
  margin: 32px 12px;
  display: flex;
  justify-content: space-between;
  color: var(--cool-gray);
}

.total-amount {
  color: var(--purplish-blue);
  font-weight: var(--ff-lg);
}

/*  */
.nav {
  position: absolute;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

button {
  background-color: var(--marine-blue);
  color: var(--white);
  padding: 1em 2em;
  border: none;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: var(--ff-lg);
  margin-right: 3em;
}

button:hover {
  cursor: pointer;
  background-color: hsl(243, 100%, 62%, 0.7);
}

.nav p {
  margin: unset;
  color: var(--cool-gray);
  font-weight: var(--ff-lg);
  text-transform: capitalize;
}

.nav p:hover {
  color: var(--marine-blue);
  font-weight: var(--ff-lg);
  cursor: pointer;
}

.hide-el {
  opacity: 0;
}

.hide-navbtn {
  display: none;
}

/* Mobile Viewport */

@media (max-width:800px) {
  main {
    grid-template-columns: repeat(1, 1fr);
    position: relative;
    gap: unset;
    height: 800px;
    padding: unset;
    width: 500px;
    background-color: var(--magnolia);
  }

  .page {
    margin-right: 0;
    width: -webkit-fill-available;
  }

  .page p {
    font-size: 16px;
  }

  #sidebar {
    background-image: url(./assets/images/bg-sidebar-mobile.svg);
    display: flex;
    gap: 1em;
    height: 200px;
    width: 100%;
    align-items: center;
    justify-content: center;
  }

  #sidebar .steps {
    height: min-content;
  }

  #sidebar .btn-info {
    display: none;
  }

  #mainpage {
    display: flex;
    transform: translateY(-100px);
    background-color: var(--white);
    margin: 0 2em;
    padding: 0 1em 20px;
    border-radius: 10px;
    height: 560px;
  }

  .nav {
    background-color: var(--white);
    padding: 16px;
    align-items: center;
  }

  button {
    margin-right: 0;
  }

  #plans {
    width: 100%;
  }

  .plans {
    display: inherit;
    flex-direction: column;

  }

  .plans label {
    flex-direction: row;
    justify-content: unset;
    height: unset;
    gap: 16px;
    width: 100%;
  }

  .summary-info {
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .summary-info img {
    margin: unset;
    margin-bottom: 16px;
  }
}


@media (max-width: 450px) {
  main {
    width: unset;
  }

  .summary-info p {
    width: unset;
  }

  #mainpage {
    margin: 0 auto;
    width: 90%;
  }

  .add-ons-type span {
    font-size: 12px;
  }

}

.hidden {
  display: none;
}