:root {
  --navy: #003189;
  --amber: #FA8A1A;
  --charcoal: #0D0D1A;
  --off-white: #F8FAFC;
  --emerald: #16A34A;
  --crimson: #DC2626;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--navy) 0%, #001a4d 100%);
  color: var(--charcoal);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.container {
  background: var(--off-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 480px;
  width: 100%;
  overflow: hidden;
}

.header {
  background: var(--navy);
  color: white;
  padding: 24px 20px;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo-icon {
  font-size: 28px;
}

.logo h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.subtitle {
  font-size: 14px;
  opacity: 0.85;
}

.screen {
  display: none;
  padding: 24px 20px;
  animation: fadeIn var(--transition) ease-out;
}

.screen.active {
  display: block;
}

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

h2 {
  font-size: 18px;
  text-align: center;
  color: var(--charcoal);
  margin-bottom: 20px;
}

.stars-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.star-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.star-btn:hover,
.star-btn:focus {
  border-color: var(--amber);
  transform: scale(1.08);
}

.star-btn.selected {
  border-color: var(--amber);
  background: rgba(250, 138, 26, 0.1);
  transform: scale(1.1);
}

.star-btn .star-icon {
  font-size: 28px;
  color: #cbd5e1;
  transition: color var(--transition);
}

.star-btn.active .star-icon {
  color: var(--amber);
}

.star-btn .emoji {
  font-size: 20px;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition);
}

.star-btn.selected .emoji {
  opacity: 1;
  transform: scale(1);
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

.rating-label {
  text-align: center;
  font-size: 14px;
  color: #64748b;
  min-height: 20px;
  margin-bottom: 16px;
}

.result-icon {
  font-size: 56px;
  text-align: center;
  margin-bottom: 16px;
  animation: bounce 0.6s ease;
}

.thank-you-text,
.apology-text,
.submitted-text {
  text-align: center;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.review-templates {
  margin-bottom: 20px;
}

.review-templates h3 {
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 10px;
}

.template {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--transition);
}

.template:hover {
  background: #e2e8f0;
}

.template-text {
  font-size: 13px;
  color: #334155;
  flex: 1;
}

.btn-copy {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background var(--transition);
}

.btn-copy:hover {
  background: #cbd5e1;
}

.btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 10px;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: #002266;
  transform: translateY(-1px);
}

.btn-google {
  background: var(--amber);
  color: white;
  font-size: 15px;
}

.btn-google:hover {
  background: #e07a10;
  transform: translateY(-1px);
}

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

.btn-zalo:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--charcoal);
}

.btn-secondary:hover {
  background: #cbd5e1;
}

.feedback-form {
  margin-bottom: 8px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 6px;
}

.required {
  color: var(--crimson);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
  background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(0, 49, 137, 0.1);
}

.form-group textarea {
  resize: vertical;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--charcoal);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.4s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.footer {
  text-align: center;
  padding: 16px 20px;
  font-size: 12px;
  color: #94a3b8;
  border-top: 1px solid #f1f5f9;
}

.footer strong {
  color: var(--navy);
}

.loading {
  pointer-events: none;
  opacity: 0.7;
}

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

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

/* Embedded inside WordPress or external page */
body.is-embedded {
  background: transparent !important;
  min-height: auto !important;
  padding: 0 !important;
  display: block !important;
}

body.is-embedded .container {
  max-width: 100% !important;
  border-radius: 16px !important;
  box-shadow: 0 4px 24px rgba(0, 49, 137, 0.08) !important;
  border: 1px solid #E2E8F0 !important;
  margin: 0 auto !important;
  background: #FFFFFF !important;
}

body.is-embedded .header {
  padding: 16px 20px !important;
}

body.is-embedded .logo {
  margin-bottom: 4px !important;
}

body.is-embedded .logo-icon {
  font-size: 24px !important;
}

body.is-embedded .logo h1 {
  font-size: 18px !important;
}

body.is-embedded .subtitle {
  font-size: 13px !important;
  opacity: 0.9 !important;
}

body.is-embedded .screen {
  padding: 18px 20px 20px !important;
}

body.is-embedded h2 {
  font-size: 16px !important;
  margin-bottom: 14px !important;
  line-height: 1.4 !important;
}

body.is-embedded .stars-container {
  gap: 6px !important;
  margin-bottom: 10px !important;
}

body.is-embedded .star-btn {
  padding: 10px 12px !important;
}

body.is-embedded .star-btn .star-icon {
  font-size: 26px !important;
}

body.is-embedded .star-btn .emoji {
  font-size: 18px !important;
}

body.is-embedded .rating-label {
  margin-bottom: 12px !important;
  font-size: 13px !important;
  min-height: 18px !important;
}

body.is-embedded .btn {
  padding: 12px 20px !important;
  font-size: 15px !important;
  border-radius: 10px !important;
  margin-bottom: 8px !important;
}

body.is-embedded .footer {
  padding: 10px 16px !important;
  font-size: 11px !important;
}

@media (max-width: 480px) {
  body.is-embedded .header {
    padding: 12px 14px !important;
  }
  body.is-embedded .logo {
    margin-bottom: 2px !important;
  }
  body.is-embedded .logo-icon {
    font-size: 20px !important;
  }
  body.is-embedded .logo h1 {
    font-size: 16px !important;
  }
  body.is-embedded .subtitle {
    font-size: 12px !important;
  }
  body.is-embedded .screen {
    padding: 14px 14px 16px !important;
  }
  body.is-embedded h2 {
    font-size: 15px !important;
    margin-bottom: 10px !important;
  }
  body.is-embedded .stars-container {
    gap: 4px !important;
    margin-bottom: 8px !important;
  }
  body.is-embedded .star-btn {
    padding: 8px 10px !important;
  }
  body.is-embedded .star-btn .star-icon {
    font-size: 24px !important;
  }
  body.is-embedded .star-btn .emoji {
    font-size: 16px !important;
  }
  body.is-embedded .rating-label {
    margin-bottom: 10px !important;
    font-size: 12px !important;
    min-height: 16px !important;
  }
  body.is-embedded .btn {
    padding: 11px 16px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
    margin-bottom: 6px !important;
  }
  body.is-embedded .footer {
    padding: 8px 12px !important;
    font-size: 10px !important;
  }
}
