@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --color-primary: #D6006F;
  --color-primary-dark: #A8005A;
  --color-white: #FFFFFF;
  --color-text: #2B2B2B;
  --color-bg: #FFF5F8;
  --color-border: #F0D6E0;
  --color-gray: #6B6B6B;
  --color-track: #F0F0F0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --font-display: 'Fredoka', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l10 10-10 10-10-10zm0 40l10 10-10 10-10-10z' fill='%23D6006F' fill-opacity='0.06'/%3E%3C/svg%3E");
  background-size: 60px 60px;
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-white);
  box-shadow: var(--shadow);
}

header {
  background: var(--color-white);
  padding: 1rem 1rem 0.875rem;
  border-bottom: 1px solid var(--color-border);
}

.logo {
  text-align: center;
  margin-bottom: 0.875rem;
}

.logo img {
  max-height: 112px;
  max-width: 85%;
  height: auto;
  display: block;
  margin: 0 auto;
  animation: logoFadeIn 0.4s ease-out;
}

@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.5px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--color-track);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.4s ease;
  width: 14.28%;
}

main {
  padding: 1.25rem 1rem 2rem;
  min-height: calc(100vh - 150px);
  position: relative;
  overflow: hidden;
}

.question {
  display: none;
  opacity: 0;
}

.question.active {
  display: block;
  animation: slideInRight 0.3s ease forwards;
}

.question.exit-left {
  animation: slideOutLeft 0.3s ease forwards;
}

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

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

@keyframes bounceSelect {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  font-weight: 700;
}

.hint {
  font-size: 0.9rem;
  color: var(--color-gray);
  margin-bottom: 1.5rem;
}

.emoji-scale {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.75rem;
  margin: 2rem 0;
}

.emoji-btn {
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 90px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.emoji-btn:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.emoji-btn:active {
  transform: scale(0.97);
}

.emoji-btn.selected {
  background: #FFE5F0;
  border: 2px solid var(--color-primary);
  color: var(--color-text);
  animation: bounceSelect 0.25s ease;
}

.emoji {
  font-size: 2rem;
  filter: grayscale(100%);
  transition: filter 0.2s;
}

.emoji-btn.selected .emoji,
.emoji-btn:hover .emoji {
  filter: grayscale(0);
}

.label {
  font-size: 0.75rem;
  text-align: center;
}

.star-scale {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0;
}

.star-btn {
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 12px;
  padding: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #E0E0E0;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.star-btn:hover {
  border-color: var(--color-primary);
  color: #FFD700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.star-btn:active {
  transform: scale(0.97);
}

.star-btn.selected {
  background: #FFE5F0;
  border: 2px solid var(--color-primary);
  color: #FFD700;
  animation: bounceSelect 0.25s ease;
}

.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 3px;
  margin: 2rem -1rem;
  padding: 0 1rem;
}

.nps-btn {
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 2px;
  font-size: clamp(0.65rem, 2.8vw, 0.85rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  min-width: 0;
  white-space: nowrap;
  box-sizing: border-box;
}

.nps-btn:hover {
  border-color: var(--color-primary);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nps-btn:active {
  transform: scale(0.97);
}

.nps-btn.selected.detractor {
  background: #FFE0E0;
  border: 2px solid #D32F2F;
  color: #D32F2F;
  animation: bounceSelect 0.25s ease;
}

.nps-btn.selected.passive {
  background: #FFF3D6;
  border: 2px solid #F57C00;
  color: #F57C00;
  animation: bounceSelect 0.25s ease;
}

.nps-btn.selected.promoter {
  background: #E3F4E1;
  border: 2px solid #2E7D32;
  color: #2E7D32;
  animation: bounceSelect 0.25s ease;
}

.nps-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--color-gray);
  margin-top: 0.5rem;
}

.text-input {
  width: 100%;
  padding: 0.875rem;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
  margin-top: 1rem;
}

.text-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.text-input.error {
  border-color: #D32F2F;
}

.field-error {
  color: #D32F2F;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: none;
}

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

textarea.text-input {
  resize: vertical;
  min-height: 100px;
}

.contact-section {
  background: var(--color-bg);
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1rem;
}

.contact-intro {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  text-align: center;
}

.privacy-note {
  font-size: 0.85rem;
  color: var(--color-gray);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-text);
}

.checkbox-group {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--color-primary);
}

.nav-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.btn {
  flex: 1;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 54px;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(214, 0, 111, 0.3);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-bg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error-msg {
  color: #D64545;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  display: none;
}

.error-msg.show {
  display: block;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

:where(button, input, textarea, a):focus-visible {
  outline: 3px solid var(--color-primary-dark);
  outline-offset: 3px;
}

.progress-bar[role="progressbar"] {
  position: relative;
}

.progress-bar[role="progressbar"]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.success-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.success-content {
  max-width: 400px;
  position: relative;
  z-index: 2;
}

.success-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

.checkmark-circle {
  stroke: var(--color-primary);
  stroke-width: 3;
  fill: none;
  animation: drawCircle 0.6s ease-out forwards;
}

.checkmark-check {
  stroke: var(--color-primary);
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: drawCheck 0.4s 0.4s ease-out forwards;
}

@keyframes drawCircle {
  from {
    stroke-dasharray: 0 315;
  }
  to {
    stroke-dasharray: 315 315;
  }
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.success-content h2 {
  font-family: var(--font-display);
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.success-content p {
  font-size: 1.1rem;
  color: var(--color-gray);
  margin-bottom: 1rem;
}

.coupon-placeholder {
  background: var(--color-white);
  color: var(--color-text);
  padding: 1.5rem;
  border-radius: 10px;
  font-size: 1rem;
  margin-top: 2rem;
  border: 2px dashed var(--color-primary);
  position: relative;
  box-shadow: 0 4px 16px rgba(214, 0, 111, 0.15);
}

.coupon-placeholder::before,
.coupon-placeholder::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--color-bg);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
}

.coupon-placeholder::before {
  left: -10px;
}

.coupon-placeholder::after {
  right: -10px;
}

.coupon-placeholder strong {
  display: block;
  font-size: 1.75rem;
  margin-top: 0.5rem;
  letter-spacing: 3px;
  color: var(--color-primary);
  font-weight: 700;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--color-primary);
  animation: confettiFall 3s ease-out forwards;
  opacity: 0;
}

.confetti:nth-child(1) { left: 10%; animation-delay: 0s; background: var(--color-primary); }
.confetti:nth-child(2) { left: 20%; animation-delay: 0.1s; background: #FFD700; }
.confetti:nth-child(3) { left: 30%; animation-delay: 0.2s; background: var(--color-white); }
.confetti:nth-child(4) { left: 40%; animation-delay: 0.15s; background: var(--color-primary); }
.confetti:nth-child(5) { left: 50%; animation-delay: 0.25s; background: #FFD700; }
.confetti:nth-child(6) { left: 60%; animation-delay: 0.05s; background: var(--color-white); }
.confetti:nth-child(7) { left: 70%; animation-delay: 0.3s; background: var(--color-primary); }
.confetti:nth-child(8) { left: 80%; animation-delay: 0.2s; background: #FFD700; }
.confetti:nth-child(9) { left: 90%; animation-delay: 0.1s; background: var(--color-white); }
.confetti:nth-child(10) { left: 95%; animation-delay: 0.05s; background: var(--color-primary); }

@keyframes confettiFall {
  0% {
    top: -10%;
    opacity: 1;
    transform: rotate(0deg);
  }
  100% {
    top: 100%;
    opacity: 0;
    transform: rotate(720deg);
  }
}

@media (max-width: 480px) {
  .emoji-scale {
    grid-template-columns: repeat(3, 1fr);
  }

  h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 320px) {
  .nps-scale {
    gap: 2px;
  }
}
