/* ============================================================
   RC Soluciones Digitales — Review System v8.0
   Premium Dark · Mobile-first · Professional
   ============================================================ */

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

:root {
  --bg: #030712;
  --bg-surface: #0f172a;
  --surface: rgba(15, 23, 42, 0.8);
  --surface-hover: rgba(30, 41, 59, 0.9);
  --glass: rgba(15, 23, 42, 0.92);
  --glass-border: rgba(59, 130, 246, 0.12);
  --text: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.3);
  --accent-dim: rgba(37, 99, 235, 0.08);
  --green: #22c55e;
  --green-glow: rgba(34, 197, 94, 0.15);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.08);
  --star-color: #eab308;
  --star-glow: rgba(234, 179, 8, 0.25);
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 500px at 20% 10%, rgba(37, 99, 235, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 500px 400px at 80% 90%, rgba(37, 99, 235, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Container ─── */
.app-container {
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 1;
}

/* ─── Card ─── */
.card {
  background: var(--glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* ─── Steps ─── */
.step {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ─── Progress Bar ─── */
.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ─── Header ─── */
.header {
  text-align: center;
  margin-bottom: 36px;
  margin-top: 12px;
}

.logo-wrapper {
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
}

.logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
}

.logo-fallback {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.business-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 6px;
  color: var(--text);
}

.business-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ─── Question ─── */
.question {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 36px;
  color: var(--text-secondary);
}

/* ─── Stars ─── */
.stars-container {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 12px 0;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
}

.star-btn:hover { transform: scale(1.18); }
.star-btn:active { transform: scale(0.92); }

.star-btn svg {
  width: 50px;
  height: 50px;
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 0.6;
  transition: all 0.25s ease;
}

.star-btn.selected svg {
  fill: var(--star-color);
  stroke: var(--star-color);
  filter: drop-shadow(0 0 12px var(--star-glow));
}

.star-btn.hover svg {
  fill: var(--star-color);
  stroke: var(--star-color);
  opacity: 0.4;
}

/* ─── Score label ─── */
.score-label {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  min-height: 24px;
  opacity: 0;
  transition: opacity var(--transition);
}

.score-label.visible { opacity: 1; }

/* ─── Powered by ─── */
.powered {
  text-align: center;
  margin-top: 32px;
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════
   PROMOTER
   ═══════════════════════════════════════════════ */

.celebration {
  text-align: center;
  margin-bottom: 32px;
  margin-top: 12px;
}

.celebration-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.celebration h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.celebration p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─── Platform buttons ─── */
.platform-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.platform-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.platform-btn:active { transform: translateY(0); }

.platform-btn .platform-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
}

.platform-btn .platform-label {
  flex: 1;
  text-align: left;
}

.platform-btn .platform-sublabel {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 3px;
}

.platform-btn .platform-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
  transition: transform var(--transition), color var(--transition);
}

.platform-btn:hover .platform-arrow {
  transform: translateX(4px);
  color: var(--accent-light);
}

/* Platform hover colors */
.platform-btn[data-platform="google"]:hover { border-color: #4285F4; box-shadow: 0 8px 32px rgba(66, 133, 244, 0.15); }
.platform-btn[data-platform="tripadvisor"]:hover { border-color: #00AA6C; box-shadow: 0 8px 32px rgba(0, 170, 108, 0.15); }
.platform-btn[data-platform="facebook"]:hover { border-color: #1877F2; box-shadow: 0 8px 32px rgba(24, 119, 242, 0.15); }

.skip-link {
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 14px;
  cursor: pointer;
  transition: color var(--transition);
  background: none;
  border: none;
  font-family: inherit;
}

.skip-link:hover { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════
   DETRACTOR
   ═══════════════════════════════════════════════ */

.empathy {
  text-align: center;
  margin-bottom: 28px;
  margin-top: 12px;
}

.empathy-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empathy h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.empathy p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* Categories */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: center;
}

.category-chip {
  padding: 9px 18px;
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  font-weight: 500;
}

.category-chip:hover {
  border-color: rgba(37, 99, 235, 0.4);
  color: var(--text);
  background: var(--accent-dim);
}

.category-chip.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

textarea,
input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

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

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea::placeholder,
input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.optional-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.checkbox-group input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.checkbox-group label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Primary button */
.btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  box-shadow: 0 4px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════════════
   THANK YOU
   ═══════════════════════════════════════════════ */

.thankyou {
  text-align: center;
  padding: 48px 0 32px;
}

.thankyou-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.thankyou h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
}

.thankyou p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  max-width: 320px;
  margin: 0 auto;
}

.thankyou-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--glass-border);
  margin-top: 28px;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════
   LOADING
   ═══════════════════════════════════════════════ */

.loading {
  text-align: center;
  padding: 88px 0;
}

.spinner-wrapper {
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.04);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
}

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

/* ─── Error ─── */
.error-msg {
  text-align: center;
  color: var(--red);
  font-size: 0.82rem;
  margin-top: 12px;
  display: none;
  padding: 12px 16px;
  background: var(--red-soft);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.12);
  font-weight: 500;
}

.error-msg.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.error-state {
  text-align: center;
  padding: 56px 0;
}

.error-state .error-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--red-soft);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--red);
  font-weight: 700;
}

.error-state h2 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.error-state p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

.btn-retry {
  padding: 12px 32px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-retry:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (min-width: 600px) {
  .optional-fields { grid-template-columns: 1fr 1fr; }
  .star-btn svg { width: 56px; height: 56px; }
  .card { padding: 44px 36px; }
  .stars-container { gap: 10px; }
}

@media (max-width: 380px) {
  .star-btn svg { width: 42px; height: 42px; }
  .stars-container { gap: 2px; }
  .business-name { font-size: 1.3rem; }
  .card { padding: 32px 22px; }
}

/* ═══════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════ */

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

*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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