* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 2rem);
}

.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.logo-container {
  text-align: center;
  padding: 2rem 2rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.logo {
  max-height: 50px;
  max-width: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.form-title {
  font-size: 1.5rem;
  color: #333;
  margin-top: 1rem;
  font-weight: 600;
}

.step {
  display: none;
  padding: 2rem;
  position: relative;
  width: 100%;
}

.step.active {
  display: block;
}

.step:not(.active) {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: -9999px;
  left: -9999px;
}

.input-group {
  margin-bottom: 2rem;
}

input[type="text"] {
  width: 100%;
  padding: 1.5rem;
  border: none;
  border-bottom: 3px solid #e1e5e9;
  background: transparent;
  font-size: 1.2rem;
  outline: none;
  transition: border-color 0.3s;
  margin-bottom: 1rem;
}

input[type="text"]:focus {
  border-bottom-color: #667eea;
}

input[type="text"]::placeholder {
  font-size: 1.1rem;
  color: #999;
}

.form-scroll {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: #667eea #f1f1f1;
}

.form-scroll::-webkit-scrollbar {
  width: 8px;
}

.form-scroll::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.form-scroll::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 4px;
}

.form-scroll::-webkit-scrollbar-thumb:hover {
  background: #5a67d8;
}

.question-group {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #f0f0f0;
}

.question-group:last-child {
  border-bottom: none;
  margin-bottom: 1rem;
}

.question-group h3 {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1rem;
  line-height: 1.4;
  font-weight: 600;
}

.checkbox-group,
.radio-group,
.rating-scale {
  display: grid;
  gap: 0.75rem;
}

.checkbox-group label,
.radio-group label,
.rating-scale label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  background: #fafafa;
}

.checkbox-group label:hover,
.radio-group label:hover,
.rating-scale label:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-1px);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #667eea;
}

.record-section {
  text-align: center;
  margin-top: 1rem;
}

.record-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: 2px dashed #667eea;
  border-radius: 12px;
  background: #f8f9ff;
  color: #667eea;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
  font-weight: 500;
}

.record-btn:hover {
  background: #667eea;
  color: white;
  border-style: solid;
}

.record-btn.recording {
  background: #dc2626;
  color: white;
  border-color: #dc2626;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.audio-controls {
  margin-top: 1rem;
  text-align: center;
}

.audio-controls audio {
  width: 100%;
  max-width: 300px;
  margin-bottom: 1rem;
}

.cancel-btn {
  padding: 0.5rem 1rem;
  border: 1px solid #dc2626;
  border-radius: 8px;
  background: white;
  color: #dc2626;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.cancel-btn:hover {
  background: #dc2626;
  color: white;
}

.recording-status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #666;
  min-height: 20px;
}

.textarea-container {
  position: relative;
  margin-top: 1rem;
}

.textarea-container textarea {
  width: 100%;
  padding: 1.5rem;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  background: #fafafa;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 0.3s ease;
  min-height: 120px;
}

.textarea-container textarea:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.textarea-container textarea::placeholder {
  color: #999;
  font-size: 0.95rem;
  line-height: 1.5;
}

.submit-btn {
  width: 100%;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.next-btn {
  width: 100%;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 2rem;
}

.next-btn:hover,
.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.success-icon {
  text-align: center;
  font-size: 3rem;
  margin-bottom: 1rem;
}

#message {
  text-align: center;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
}

/* Mobile First Responsive Design */
@media (max-width: 320px) {
  body {
    padding: 0.25rem;
    overflow-x: hidden;
    align-items: flex-start;
  }
  
  .container {
    width: 100vw;
    margin: 0;
    min-height: calc(100vh - 0.5rem);
    align-items: flex-start;
  }
  
  .card {
    border-radius: 0;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
  }
  
  .step {
    padding: 0.75rem;
    position: relative;
    width: 100%;
  }
  
  .step:not(.active) {
    display: none !important;
    position: absolute;
    top: -9999px;
    left: -9999px;
    visibility: hidden;
  }
  
  .logo-container {
    padding: 1rem 0.5rem 0.5rem;
  }
  
  .form-title {
    font-size: 1.1rem;
  }
  
  .question-group h3 {
    font-size: 0.9rem;
    line-height: 1.3;
  }
  
  .checkbox-group label,
  .radio-group label,
  .rating-scale label {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
    gap: 0.5rem;
  }
  
  .form-scroll {
    max-height: 45vh;
  }
  
  .record-btn {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
    overflow-x: hidden;
    align-items: flex-start;
  }
  
  .container {
    margin: 0;
    height: 100vh;
    width: 100vw;
    position: relative;
    min-height: 100vh;
    align-items: flex-start;
  }
  
  .card {
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
  }
  
  .step {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: 100%;
  }
  
  .step:not(.active) {
    display: none !important;
    position: absolute;
    top: -9999px;
    left: -9999px;
    visibility: hidden;
    opacity: 0;
  }
  
  .step.active {
    display: flex !important;
    position: relative;
    top: auto;
    left: auto;
    visibility: visible;
    opacity: 1;
  }
  
  .form-scroll {
    max-height: calc(100vh - 180px);
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .question-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
  }
  
  .question-group h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }
  
  .checkbox-group,
  .radio-group,
  .rating-scale {
    gap: 0.5rem;
  }
  
  .checkbox-group label,
  .radio-group label,
  .rating-scale label {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .record-btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .next-btn,
  .submit-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    margin-top: 1rem;
  }
  
  .logo-container {
    padding: 1rem 1rem 0.5rem;
  }
  
  .form-title {
    font-size: 1.2rem;
    margin-top: 0.5rem;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .container {
    max-width: 95%;
    padding: 0 1rem;
  }
  
  .step {
    padding: 1.5rem;
  }
  
  .logo-container {
    padding: 1.5rem 1rem 1rem;
  }
  
  .form-title {
    font-size: 1.3rem;
  }
  
  .question-group h3 {
    font-size: 1rem;
  }
  
  .checkbox-group,
  .radio-group,
  .rating-scale {
    gap: 0.6rem;
  }
  
  .checkbox-group label,
  .radio-group label,
  .rating-scale label {
    padding: 0.7rem 0.9rem;
    font-size: 0.95rem;
  }
  
  .form-scroll {
    max-height: 55vh;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    max-width: 90%;
  }
  
  .step {
    padding: 2rem;
  }
  
  .form-scroll {
    max-height: 65vh;
  }
}

@media (min-width: 1025px) {
  .container {
    max-width: 800px;
  }
  
  .step {
    padding: 2.5rem;
  }
  
  .form-scroll {
    max-height: 70vh;
  }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
  .form-scroll {
    max-height: 40vh;
  }
  
  .logo-container {
    padding: 1rem 2rem 0.5rem;
  }
  
  .form-title {
    font-size: 1.2rem;
    margin-top: 0.5rem;
  }
}

/* Touch device optimizations */
@media (pointer: coarse) {
  .checkbox-group label,
  .radio-group label,
  .rating-scale label {
    min-height: 44px;
  }
  
  .record-btn {
    min-height: 48px;
  }
  
  .next-btn,
  .submit-btn {
    min-height: 48px;
  }
}