/* ============================================================
   Restaurant CRM – Review Funnel — Public Styles
   Mobile-first, SaaS-grade UX
   ============================================================ */

:root {
  --jrf-color:   #c0392b;
  --jrf-dark:    #0f172a;
  --jrf-gray:    #6b7280;
  --jrf-light:   #f8fafc;
  --jrf-border:  #e2e8f0;
  --jrf-radius:  16px;
  --jrf-shadow:  0 4px 24px rgba(0,0,0,.10);
  --jrf-success: #10b981;
  --jrf-font:    -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Page wrapper ────────────────────────────────────────── */
#jrf-app {
  font-family: var(--jrf-font);
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f4ff 0%, #fff5f5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.jrf-page-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Brand header ────────────────────────────────────────── */
.jrf-brand-header {
  text-align: center;
  margin-bottom: 24px;
}
.jrf-brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--jrf-gray);
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* ── Screens ─────────────────────────────────────────────── */
.jrf-screen {
  background: #fff;
  border-radius: var(--jrf-radius);
  box-shadow: var(--jrf-shadow);
  padding: 36px 32px;
  text-align: center;
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .35s ease, transform .35s ease;
}
.jrf-screen.jrf-screen-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: jrf-slide-in .35s ease;
}
@keyframes jrf-slide-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ──────────────────────────────────────────── */
.jrf-screen h2 {
  font-size: clamp(20px, 5vw, 26px);
  font-weight: 800;
  color: var(--jrf-dark);
  margin: 0 0 10px;
  line-height: 1.3;
}
.jrf-subtext {
  font-size: 15px;
  color: var(--jrf-gray);
  margin: 0 0 28px;
  line-height: 1.6;
}
.jrf-screen-icon, .jrf-happy-icon, .jrf-unhappy-icon {
  font-size: 52px;
  margin-bottom: 12px;
  animation: jrf-bounce .6s ease;
}
@keyframes jrf-bounce {
  0%,100% { transform: translateY(0); }
  40%     { transform: translateY(-12px); }
  60%     { transform: translateY(-6px); }
}

/* ── Stars Widget ────────────────────────────────────────── */
.jrf-stars-widget {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
}
.jrf-star {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: transform .15s ease, filter .15s ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.jrf-star svg {
  width: 44px;
  height: 44px;
  fill: #e2e8f0;
  stroke: none;
  transition: fill .2s ease, filter .2s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.08));
}
.jrf-star:hover svg,
.jrf-star.jrf-star-hover svg,
.jrf-star.jrf-star-active svg {
  fill: #f59e0b;
  filter: drop-shadow(0 2px 8px rgba(245,158,11,.4));
}
.jrf-star:hover {
  transform: scale(1.2);
}
.jrf-star.jrf-star-active {
  transform: scale(1.1);
}

/* Star pulse on click */
.jrf-star.jrf-star-clicked {
  animation: jrf-star-pop .25s ease;
}
@keyframes jrf-star-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1.1); }
}

.jrf-rating-label {
  min-height: 24px;
  font-size: 15px;
  font-weight: 600;
  color: var(--jrf-color);
  margin-bottom: 20px;
  transition: opacity .2s ease;
}

/* ── Buttons ─────────────────────────────────────────────── */
.jrf-next-btn,
.jrf-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--jrf-color);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  padding: 14px 32px;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 14px rgba(192,57,43,.3);
  width: 100%;
  justify-content: center;
}
.jrf-next-btn:hover,
.jrf-submit-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(192,57,43,.4);
}
.jrf-next-btn:active,
.jrf-submit-btn:active {
  transform: translateY(0);
}

.jrf-skip-link {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 13px;
  cursor: pointer;
  margin-top: 14px;
  display: block;
  width: 100%;
  text-align: center;
  transition: color .2s;
}
.jrf-skip-link:hover { color: var(--jrf-gray); text-decoration: underline; }

/* ── CTA Buttons ─────────────────────────────────────────── */
.jrf-platform-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.jrf-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s, box-shadow .2s, filter .2s;
  cursor: pointer;
}
.jrf-cta-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.jrf-cta-google {
  background: #fff;
  color: #374151;
  border: 2px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.jrf-cta-google:hover { box-shadow: 0 4px 20px rgba(0,0,0,.15); border-color: #d1d5db; }
.jrf-cta-ta  { background: #00af87; color: #fff; }
.jrf-cta-fb  { background: #1877f2; color: #fff; }

/* ── Progress Steps ──────────────────────────────────────── */
.jrf-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 24px auto;
  max-width: 300px;
}
.jrf-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.jrf-step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800;
  background: #f3f4f6; color: #9ca3af;
  border: 2px solid #e5e7eb;
  transition: all .3s ease;
}
.jrf-step-done .jrf-step-circle  { background: var(--jrf-success); color: #fff; border-color: var(--jrf-success); }
.jrf-step-active .jrf-step-circle{ background: var(--jrf-color);   color: #fff; border-color: var(--jrf-color); }
.jrf-step-label { font-size: 11px; color: var(--jrf-gray); white-space: nowrap; }
.jrf-step-line  { flex: 1; height: 2px; background: #e5e7eb; min-width: 40px; margin: 0 8px; margin-bottom: 18px; }

/* ── Mini steps (unhappy flow) ───────────────────────────── */
.jrf-mini-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
}
.jrf-mini-step {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: #f3f4f6; color: #9ca3af;
  border: 2px solid #e5e7eb;
  transition: all .3s ease;
}
.jrf-mini-step.active   { background: var(--jrf-color); color: #fff; border-color: var(--jrf-color); }
.jrf-mini-step.done     { background: var(--jrf-success); color: #fff; border-color: var(--jrf-success); }
.jrf-mini-step-line     { width: 32px; height: 2px; background: #e5e7eb; }

/* ── Category grid ───────────────────────────────────────── */
.jrf-step-title {
  font-size: 15px; font-weight: 600; color: var(--jrf-dark);
  margin-bottom: 16px; text-align: left;
}
.jrf-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 0;
}
.jrf-cat-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 6px;
  cursor: pointer;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.jrf-cat-btn:hover { border-color: var(--jrf-color); background: #fff5f5; }
.jrf-cat-btn.selected { border-color: var(--jrf-color); background: #fff5f5; box-shadow: 0 0 0 3px rgba(192,57,43,.15); }
.jrf-cat-icon { font-size: 24px; }
.jrf-cat-label { font-size: 11px; font-weight: 600; color: #374151; }

/* ── Textarea ────────────────────────────────────────────── */
.jrf-textarea {
  width: 100%;
  border: 2px solid var(--jrf-border);
  border-radius: 10px;
  padding: 14px;
  font-size: 14px;
  font-family: var(--jrf-font);
  line-height: 1.6;
  resize: vertical;
  color: var(--jrf-dark);
  transition: border-color .2s;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.jrf-textarea:focus { outline: none; border-color: var(--jrf-color); }
.jrf-char-count { font-size: 12px; color: #9ca3af; text-align: right; margin-bottom: 14px; }

/* ── Confirm box ─────────────────────────────────────────── */
.jrf-confirm-box {
  background: #f8fafc;
  border: 1.5px solid var(--jrf-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: left;
}
.jrf-confirm-icon { font-size: 32px; text-align: center; margin-bottom: 8px; }
.jrf-confirm-box h3 { font-size: 16px; font-weight: 700; color: var(--jrf-dark); margin: 0 0 12px; text-align: center; }
.jrf-confirm-summary { font-size: 14px; color: #374151; line-height: 1.7; }

/* ── Success screen ──────────────────────────────────────── */
.jrf-success-anim { margin-bottom: 16px; }
.jrf-success-circle {
  width: 72px; height: 72px;
  background: var(--jrf-success);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800;
  margin: 0 auto;
  animation: jrf-pop-in .5s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes jrf-pop-in {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.jrf-home-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--jrf-gray);
  font-size: 14px;
  text-decoration: none;
}
.jrf-home-link:hover { text-decoration: underline; }

/* ── Confetti ────────────────────────────────────────────── */
.jrf-confetti {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; overflow: hidden;
  border-radius: var(--jrf-radius);
}
.jrf-confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: jrf-confetti-fall 2s ease-in forwards;
}
@keyframes jrf-confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(300px) rotate(720deg); opacity: 0; }
}

/* ── Error ───────────────────────────────────────────────── */
.jrf-error {
  background: #fff;
  border-radius: var(--jrf-radius);
  padding: 32px;
  text-align: center;
  color: #b91c1c;
  box-shadow: var(--jrf-shadow);
  font-size: 15px;
  font-weight: 600;
}

/* ── Checkmark anim (already done) ──────────────────────── */
.jrf-checkmark-anim {
  font-size: 56px;
  margin-bottom: 12px;
  animation: jrf-bounce .6s ease;
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 400px) {
  .jrf-screen { padding: 28px 20px; }
  .jrf-star svg { width: 36px; height: 36px; }
  .jrf-category-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .jrf-cat-btn { padding: 10px 4px; }
  .jrf-cat-icon { font-size: 20px; }
}

/* ── Booking Lookup Screen ──────────────────────────────── */
.jrf-lookup-wrap {
  width: 100%;
  text-align: left;
}

.jrf-lookup-field {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.jrf-lookup-input {
  flex: 1;
  padding: 13px 16px;
  border: 2px solid var(--jrf-border);
  border-radius: 10px;
  font-size: 15px;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--jrf-dark);
  text-transform: uppercase;
  transition: border-color .2s;
  outline: none;
}
.jrf-lookup-input:focus {
  border-color: var(--jrf-color);
}
.jrf-lookup-input::placeholder {
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  color: #cbd5e1;
  font-family: var(--jrf-font);
}

.jrf-lookup-btn {
  background: var(--jrf-color);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.jrf-lookup-btn:hover  { filter: brightness(1.1); }
.jrf-lookup-btn:disabled { opacity: .7; cursor: not-allowed; }

.jrf-lookup-hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 0 0 12px;
  line-height: 1.5;
}

.jrf-lookup-result {
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  border: 1.5px solid #e2e8f0;
}
