:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --dark: #1e293b;
  --light: #f8fafc;
  --gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

body {
  background: linear-gradient(135deg, #f0f5ff 0%, #e0eaff 100%);
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--dark);
  line-height: 1.5;
}

.form-container {
  max-width: 800px;
  margin: 2rem auto;
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.05), 0 10px 20px rgba(59,130,246,0.1);
  overflow: hidden;
  position: relative;
  padding: 0 1rem; /* Adds space on left and right sides of the form */

}

.hidden {
    display: none;
}

.progress-bar {
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 0.25rem;
  overflow: hidden;
  margin: 1.5rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.progress {
  height: 100%;
  background: var(--gradient);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


.step-indicator {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--dark);
  margin: 1rem auto;
}


.step {
  display: none;
  animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 2rem;
}

.step.active {
  display: block;
}


.rate-prompt {
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: #000080;
    max-width: 90%; /* Constrains width for balanced appearance */
    margin: 1rem auto; /* Centers within the container */
}


.stars {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 1.5rem 0;
}

.star {
  font-size: 2.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #e2e8f0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.star:hover {
  color: #fbbf24;
  transform: scale(1.2) rotate(5deg);
}

.star.active {
  color: #fbbf24;
  transform: scale(1.1);
}

.rating-scale {
  position: relative;
  background: #f8fafc;
  border-radius: 1rem;
  margin: 1.5rem 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  padding: 1.5rem 0; /* Remove horizontal padding to allow full-width scroll */
}

/* Recommendation scale container */
#recommendation-scale {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
  white-space: nowrap;
  /* Ensure the container doesn't collapse */
  min-width: 100%;
  /* Force horizontal scroll layout */
  flex-wrap: nowrap;
}

/* Hide scrollbar for Chrome/Safari/Opera */
#recommendation-scale::-webkit-scrollbar {
  display: none;
}

.scale-number {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  border: 2px solid #e2e8f0;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  /* Prevent shrinking */
  flex: 0 0 auto;
}

.scale-number:hover {
  background: var(--gradient);
  color: white;
  transform: scale(1.1) translateY(-2px);
  border-color: transparent;
}

.scale-number.active {
  background: var(--gradient);
  color: white;
  transform: scale(1.05);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.input-group {
  margin: 1.5rem 0;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--dark);
  font-weight: 600;
  font-size: 0.95rem;
}

.input-group input,
.input-group select,
.input-group textarea {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  font-size: 1rem;
  background: #f8fafc;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.1);
  background: white;
}

.feedback-card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin: 1rem 0;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #e2e8f0;
}

.feedback-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.05);
  border-color: var(--primary-light);
}

.service-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 1.5rem;
  text-align: center;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.btn {
  padding: 0.875rem 2rem;
  border-radius: 0.75rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(59,130,246,0.4);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--dark);
  border: none;
}

.btn-secondary:hover {
  background: #cbd5e1;
  transform: translateY(-2px);
}

.success-message {
  display: none;
  text-align: center;
  padding: 3rem 2rem;
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-message h2 {
  color: var(--primary-dark);
  margin-bottom: 1rem;
}

@keyframes slideIn {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
  }

  .form-container {
    margin: 0;
    width: 100%;
    border-radius: 1rem;
  }

  .step {
    padding: 1.5rem;
  }

  .stars {
    gap: 0.5rem;
  }

  .star {
    font-size: 2rem;
  }

  .scale-number {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }

  .service-title {
    font-size: 1.25rem;
  }

  .feedback-card {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .rating-scale {
    padding: 1rem 0;
    margin: 1rem 0;
  }

  #recommendation-scale {
    gap: 0.35rem;
    padding: 0 1rem;
    /* Ensure proper touch scrolling */
    -webkit-overflow-scrolling: touch;
    /* Force container to take full width */
    width: 100%;
  }

  .scale-number {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
  }

  /* Add text above the scale */
  .rating-scale .text-center {
    padding: 0 1rem 1rem 1rem;
  }
}

/* Title adjustment for small screens */
@media (max-width: 640px) {
  #overall-experience {
    font-size: 1.5rem;
    padding: 0 1rem;
  }
}

/* Ensure the container for everything is properly set */
#final-step {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.logo-container {
  text-align: center;
  padding: 2rem 2rem 1rem;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}

.hospital-logo {
  width: 120px;
  height: auto;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hospital-logo:hover {
  transform: scale(1.05);
}

/* Update the mobile responsive styles */
@media (max-width: 640px) {
  .logo-container {
    padding: 1.5rem 1.5rem 0.75rem;
  }

  .hospital-logo {
    width: 90px;
  }
}