/* ===========================
   FONT FACES
   =========================== */
@font-face {
  font-family: 'Ubuntu';
  src: url('./assets/fonts/Ubuntu-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Ubuntu';
  src: url('./assets/fonts/Ubuntu-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: 'Ubuntu';
  src: url('./assets/fonts/Ubuntu-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

/* ===========================
   CSS CUSTOM PROPERTIES
   =========================== */
:root {
  /* Primary */
  --blue-950: hsl(213, 96%, 18%);
  --purple-600: hsl(243, 100%, 62%);
  --blue-300: hsl(228, 100%, 84%);
  --blue-200: hsl(206, 94%, 87%);
  --red-500: hsl(354, 84%, 57%);

  /* Neutral */
  --grey-500: hsl(231, 11%, 63%);
  --purple-200: hsl(229, 24%, 87%);
  --blue-100: hsl(218, 100%, 97%);
  --blue-50: hsl(231, 100%, 99%);
  --white: hsl(0, 100%, 100%);

  /* Spacing */
  --step-circle-size: 2rem;
}

/* ===========================
   RESET & BASE
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Ubuntu', sans-serif;
  font-size: 1rem;
  font-weight: 400;
  background-color: var(--blue-100);
  color: var(--blue-950);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* ===========================
   FORM CARD
   =========================== */
.form-card {
  display: flex;
  background: var(--white);
  border-radius: 1rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
  width: min(58rem, 95vw);
  min-height: 37.5rem;
  overflow: hidden;
  position: relative;
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
  width: 17.125rem;
  flex-shrink: 0;
  background-image: url('./assets/images/bg-sidebar-desktop.svg');
  background-size: cover;
  background-position: center;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  border-radius: 0.75rem;
}

.step-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-circle {
  width: var(--step-circle-size);
  height: var(--step-circle-size);
  border-radius: 50%;
  border: 1.5px solid var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.step-circle.active {
  background-color: var(--blue-200);
  border-color: var(--blue-200);
  color: var(--blue-950);
}

.step-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.step-label {
  font-size: 0.6875rem;
  color: var(--blue-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.step-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2.5rem 6rem 1.5rem;
  position: relative;
}

/* ===========================
   STEPS (visibility)
   =========================== */
.step {
  display: none;
  flex-direction: column;
  flex: 1;
  animation: fadeIn 0.3s ease;
}

.step.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===========================
   STEP HEADINGS
   =========================== */
.step-heading {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-950);
  margin-bottom: 0.5rem;
}

.step-subheading {
  font-size: 1rem;
  color: var(--grey-500);
  margin-bottom: 2.25rem;
  line-height: 1.6;
}

/* ===========================
   FORM FIELDS (Step 1)
   =========================== */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1.25rem;
}

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

.field-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue-950);
}

.field-error {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--red-500);
  display: none;
}

.field-error.visible {
  display: block;
}

.field-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--purple-200);
  border-radius: 0.5rem;
  font-family: 'Ubuntu', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--blue-950);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.field-input::placeholder {
  color: var(--grey-500);
  font-weight: 400;
}

.field-input:hover {
  border-color: var(--purple-600);
}

.field-input:focus {
  border-color: var(--purple-600);
}

.field-input.error {
  border-color: var(--red-500);
}

/* ===========================
   PLAN CARDS (Step 2)
   =========================== */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.125rem;
  margin-bottom: 2rem;
}

.plan-card {
  border: 1.5px solid var(--purple-200);
  border-radius: 0.5rem;
  padding: 1.25rem 1rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.plan-card:hover {
  border-color: var(--purple-600);
}

.plan-card.selected {
  border-color: var(--purple-600);
  background-color: var(--blue-50);
}

.plan-icon {
  width: 2.5rem;
  height: 2.5rem;
}

.plan-details {
  margin-top: auto;
}

.plan-name {
  font-weight: 700;
  color: var(--blue-950);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.plan-price {
  font-size: 0.875rem;
  color: var(--grey-500);
}

.plan-yearly-free {
  font-size: 0.75rem;
  color: var(--blue-950);
  font-weight: 500;
  display: none;
}

.yearly-active .plan-yearly-free {
  display: block;
}

/* Toggle row */
.billing-toggle-row {
  background-color: var(--blue-50);
  border-radius: 0.5rem;
  padding: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.billing-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--grey-500);
  transition: color 0.2s ease;
}

.billing-label.active {
  color: var(--blue-950);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  width: 2.5rem;
  height: 1.25rem;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: var(--blue-950);
  border-radius: 1rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--white);
  border-radius: 50%;
  top: 50%;
  left: 0.25rem;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateY(-50%) translateX(1.25rem);
}

/* ===========================
   ADD-ONS (Step 3)
   =========================== */
.addon-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.addon-item {
  border: 1.5px solid var(--purple-200);
  border-radius: 0.5rem;
  padding: 1.125rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.addon-item:hover {
  border-color: var(--purple-600);
}

.addon-item.checked {
  border-color: var(--purple-600);
  background-color: var(--blue-50);
}

.addon-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 1.5px solid var(--purple-200);
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.addon-item.checked .addon-checkbox {
  background-color: var(--purple-600);
  border-color: var(--purple-600);
}

.addon-checkbox img {
  width: 0.75rem;
  height: 0.75rem;
  display: none;
}

.addon-item.checked .addon-checkbox img {
  display: block;
}

.addon-info {
  flex: 1;
}

.addon-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--blue-950);
}

.addon-desc {
  font-size: 0.875rem;
  color: var(--grey-500);
}

.addon-price {
  font-size: 0.875rem;
  color: var(--purple-600);
}

/* ===========================
   SUMMARY (Step 4)
   =========================== */
.summary-box {
  background-color: var(--blue-50);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.summary-plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--purple-200);
}

.summary-plan-name {
  font-weight: 700;
  color: var(--blue-950);
  font-size: 0.9375rem;
}

.summary-change-link {
  font-size: 0.875rem;
  color: var(--grey-500);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s ease;
}

.summary-change-link:hover {
  color: var(--purple-600);
}

.summary-plan-price {
  font-weight: 700;
  color: var(--blue-950);
  font-size: 0.9375rem;
}

.summary-addons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-addon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-addon-name {
  color: var(--grey-500);
  font-size: 0.875rem;
}

.summary-addon-price {
  color: var(--blue-950);
  font-size: 0.875rem;
}

.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
}

.summary-total-label {
  color: var(--grey-500);
  font-size: 0.875rem;
}

.summary-total-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple-600);
}

/* ===========================
   THANK YOU (Step 5)
   =========================== */
.thankyou-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}

.thankyou-step img {
  width: 5rem;
  height: 5rem;
  margin-bottom: 2rem;
}

.thankyou-step h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue-950);
  margin-bottom: 1rem;
}

.thankyou-step p {
  color: var(--grey-500);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 28ch;
}

/* ===========================
   NAVIGATION BUTTONS
   =========================== */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
}

.btn-back {
  background: none;
  border: none;
  color: var(--grey-500);
  font-family: 'Ubuntu', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.75rem 0;
  transition: color 0.2s ease;
}

.btn-back:hover {
  color: var(--blue-950);
}

.btn-back.hidden {
  visibility: hidden;
  pointer-events: none;
}

.btn-next {
  background-color: var(--blue-950);
  color: var(--white);
  border: none;
  border-radius: 0.5rem;
  padding: 0.875rem 1.75rem;
  font-family: 'Ubuntu', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  margin-left: auto;
}

.btn-next:hover {
  background-color: hsl(213, 96%, 26%);
}

.btn-confirm {
  background-color: var(--purple-600);
}

.btn-confirm:hover {
  background-color: hsl(243, 100%, 74%);
}

/* ===========================
   ATTRIBUTION
   =========================== */
.attribution {
  font-size: 0.6875rem;
  text-align: center;
  margin-top: 1.5rem;
  color: var(--grey-500);
}

.attribution a {
  color: hsl(228, 45%, 44%);
}

/* ===========================
   ACTIVE STATES
   =========================== */
.active-states-note {
  display: none;
}

/* ===========================
   RESPONSIVE — MOBILE
   =========================== */
@media (max-width: 700px) {
  body {
    background-color: var(--blue-100);
    justify-content: flex-start;
    padding-bottom: 5rem;
  }

  .form-card {
    flex-direction: column;
    width: 100%;
    min-height: unset;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  /* Mobile sidebar becomes top strip */
  .sidebar {
    width: 100%;
    min-height: 11rem;
    background-image: url('./assets/images/bg-sidebar-mobile.svg');
    background-size: cover;
    background-position: top;
    border-radius: 0;
    padding: 2rem 1.5rem;
    flex-direction: row;
    gap: 1rem;
    justify-content: center;
    align-items: flex-start;
  }

  .step-info {
    display: none;
  }

  .main-content {
    background: var(--white);
    border-radius: 0.75rem;
    margin: -3.5rem 1rem 0;
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    flex: unset;
  }

  .step-heading {
    font-size: 1.5rem;
  }

  .step-subheading {
    margin-bottom: 1.5rem;
  }

  .plan-grid {
    grid-template-columns: 1fr;
  }

  .plan-card {
    flex-direction: row;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
  }

  .plan-details {
    margin-top: 0;
  }

  .plan-yearly-free {
    margin-top: 0.125rem;
  }

  /* Mobile sticky nav buttons */
  .nav-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 1rem 1.5rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
    margin-top: 1rem;
  }

  .thankyou-step {
    padding: 2rem 1rem;
  }

  .thankyou-step h2 {
    font-size: 1.5rem;
  }
}
