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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background-color: #6022a7;
  color: #ffffff;
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.logo-container {
  margin-bottom: 20px;
}

.logo {
  max-width: 200px;
  height: auto;
}

.step {
  display: none;
  animation: fadeIn 0.5s ease-in;
  padding-top: 20px;
  position: relative;
}

.step.active {
  display: block;
}

.logo-icon {
  position: absolute;
  right: 50px;
  top: 20px;
  width: 160px;
  height: 160px;
  z-index: 10;
}

/* Specific positioning for Step 2 results page */
#step2 .logo-icon {
  top: 50%;
  transform: translateY(-50%);
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.main-title {
  font-size: 16px;
  font-weight: 400;
  margin-bottom: 10px;
  opacity: 0.9;
}

.subtitle {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.2;
}

.description {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 800px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 5px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}

.form-group input,
.form-group select {
  padding: 15px 20px;
  font-size: 18px;
  border: none;
  border-radius: 8px;
  background-color: #ffffff;
  color: #333;
  outline: none;
  transition: box-shadow 0.3s ease;
}

.input-with-prefix {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-prefix .prefix {
  position: absolute;
  left: 20px;
  font-size: 18px;
  color: #666;
  font-weight: 600;
  pointer-events: none;
  z-index: 1;
}

.input-with-prefix input {
  padding-left: 40px;
  width: 100%;
  flex: 1;
}

.form-group input:focus,
.form-group select:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.note {
  font-size: 13px;
  margin-top: 8px;
  opacity: 0.85;
  line-height: 1.4;
}

.unit-selector {
  display: flex;
  justify-content: flex-end; /* Push everything to the right */
  gap: 15px;
  align-items: center;
}

.unit-btn {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background-color: transparent;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
}

.unit-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.unit-btn.active {
  background-color: #ffffff;
  color: #6022a7;
}

.calculate-btn {
  padding: 12px 40px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background-color: #6022a7;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: auto;
}

.calculate-btn:hover {
  background-color: #4a1a85;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Step 2 - Results */
.results-title {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.4;
  max-width: 600px;
}

.savings-amount {
  font-size: 72px;
  font-weight: 700;
  margin-bottom: 60px;
  letter-spacing: -2px;
  line-height: 1;
}

.results-icon {
  position: absolute;
  right: 100px;
  top: 150px;
  width: 200px;
  height: 200px;
}

.download-section {
  margin-top: 40px;
  max-width: 700px;
}

.download-text {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 30px;
  opacity: 0.95;
}

.button-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.download-btn,
.calculate-again-btn {
  padding: 14px 35px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid #ffffff;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.download-btn {
  background-color: #ffffff;
  color: #6022a7;
}

.download-btn:hover {
  background-color: #f0f0f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.calculate-again-btn {
  background-color: transparent;
  color: #ffffff;
}

.calculate-again-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #ffffff;
  color: #333;
  padding: 50px;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: #333;
}

.modal-title {
  font-size: 32px;
  font-weight: 600;
  color: #6022a7;
  margin-bottom: 30px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-content .form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.modal-content .form-group input,
.modal-content .form-group select {
  padding: 12px 15px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: #ffffff;
  color: #333;
  width: 100%;
}

.modal-content .form-group input:focus,
.modal-content .form-group select:focus {
  border-color: #6022a7;
  box-shadow: 0 0 0 3px rgba(96, 34, 167, 0.1);
}

.submit-btn {
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background-color: #6022a7;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
}

.submit-btn:hover {
  background-color: #4a1a85;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(96, 34, 167, 0.3);
}

/* Loading Overlay */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(96, 34, 167, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay p {
  font-size: 18px;
  color: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .logo {
    max-width: 150px;
  }

  .subtitle {
    font-size: 28px;
  }

  .description {
    font-size: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .form-group label {
    font-size: 15px;
  }

  .form-group input,
  .form-group select {
    padding: 12px 15px;
    font-size: 16px;
  }

  .input-with-prefix .prefix {
    font-size: 16px;
    left: 15px;
  }

  .input-with-prefix input {
    padding-left: 35px;
  }

  .note {
    font-size: 12px;
    margin-top: 6px;
  }

  .unit-selector {
    flex-direction: column;
    align-items: stretch;
  }

  .calculate-btn {
    margin-left: 0;
  }

  .results-title {
    font-size: 24px;
  }

  .savings-amount {
    font-size: 48px;
  }

  .results-icon {
    position: static;
    width: 150px;
    height: 150px;
    margin: 20px auto;
  }

  .button-group {
    flex-direction: column;
  }

  .modal-content {
    padding: 30px 20px;
    width: 95%;
  }

  .modal-title {
    font-size: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .close-btn {
    top: 15px;
    right: 15px;
  }

  /* Align logo centrally on mobile results screen */
  #step2 .logo-icon,
  .logo-icon {
    position: static;
    width: 120px;
    height: 120px;
    margin: 20px auto 20px auto;
    transform: none;
  }

  /* Stretch buttons full-width below results on mobile */
  #step2 .button-group {
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 14px;
  }

  #step2 .button-group .download-btn,
  #step2 .button-group .calculate-again-btn {
    width: 100%;
    max-width: 350px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .subtitle {
    font-size: 24px;
  }

  .savings-amount {
    font-size: 36px;
    margin-bottom: 0px;
  }

  .form-group label {
    font-size: 14px;
  }

  .form-group input,
  .form-group select {
    font-size: 16px;
    padding: 12px 15px;
  }

  .input-with-prefix .prefix {
    font-size: 16px;
    left: 12px;
  }

  .input-with-prefix input {
    padding-left: 35px;
  }

  .note {
    font-size: 11px;
  }

  .unit-btn,
  .calculate-btn,
  .download-btn,
  .calculate-again-btn {
    font-size: 14px;
    padding: 10px 20px;
  }
}

/* Desktop (unchanged) */
.responsive-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  width: 100%;
}

.left-col {
  flex: 1;
  display: flex;
  justify-content: flex-end; /* Desktop: RIGHT */
  gap: 10px;
  padding-right: 30px;
}

.right-col {
  flex: 1;
  display: flex;
  justify-content: space-between; /* Desktop: RIGHT */
}

@media (min-width: 769px) and (max-width: 1024px) {
  .right-col {
    flex-wrap: wrap;
  }

  .right-btn {
    width: 100%;
    justify-content: space-between;
    display: flex;
    gap: 5px;
  }

  .right-btn .unit-btn {
    width: 50%;
  }

  .left-btn,
  .calculate-btn {
    width: 100%;
  }
}
/* ------------------------------------ */
/* MOBILE VIEW FIX                       */
/* ------------------------------------ */
@media (max-width: 768px) {
  .right-btn {
    flex-direction: row;
    display: flex;
    gap: 5px;
    justify-content: space-between;
  }

  .right-btn .unit-btn {
    width: 50%;
  }
  /* Stack vertically */
  .responsive-row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
  }

  /* KG / LBS buttons centered & equal width */
  .left-col {
    width: 100%;
    justify-content: center !important;
    display: flex;
    gap: 10px;
    padding-right: 0px;
  }

  .left-col .unit-btn {
    flex: 1;
    max-width: 180px; /* SAME WIDTH */
    width: 100%;
    text-align: center;
  }

  /* Calculate button full width & centered */
  .right-col {
    width: 100%;
    display: flex;
    justify-content: center !important;
    flex-direction: column;
  }

  .calculate-btn {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }
}
