/* ===================================================
   RESTAURANT SURVEY PLATFORM — STYLES
   Light theme, restaurant vibe, fully responsive
   =================================================== */

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

/* ── TOKENS ── */
:root {
  --bg:          #FFF8F0;
  --bg-card:     #FFFFFF;
  --bg-muted:    #FFF1E0;
  --primary:     #C8502A;
  --primary-dk:  #A83D1E;
  --primary-lt:  #F7E8E0;
  --secondary:   #8B6914;
  --accent:      #E8A838;
  --accent-lt:   #FDF3DA;
  --success:     #2E7D32;
  --text-dark:   #2C1810;
  --text-mid:    #5C3D2E;
  --text-muted:  #9E7B6B;
  --border:      #E8D5C4;
  --shadow-sm:   0 2px 8px rgba(44,24,16,0.08);
  --shadow-md:   0 8px 32px rgba(44,24,16,0.12);
  --shadow-lg:   0 20px 60px rgba(44,24,16,0.16);
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --transition:  0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── BACKGROUND PATTERN ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(200,80,42,0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(232,168,56,0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(139,105,20,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── LAYOUT ── */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── HEADER LOGO ── */
.brand-header {
  text-align: center;
  margin-bottom: 32px;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.brand-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo-icon svg { width: 26px; height: 26px; fill: white; }
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── CARD ── */
.survey-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 560px;
  overflow: hidden;
  position: relative;
}

.card-top-bar {
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
}

.card-body {
  padding: 40px 40px 36px;
}

/* ── STEPS ── */
.step {
  display: none;
  animation: stepFadeIn 0.4s ease forwards;
}
.step.active {
  display: block;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── STEP INDICATOR ── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
}
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
}
.step-dot.active { background: var(--primary); width: 24px; border-radius: 4px; }
.step-dot.done   { background: var(--accent); }

/* ── TYPOGRAPHY ── */
.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.step-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 10px;
}
.step-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}
.step-title em {
  font-style: normal;
  color: var(--primary);
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ── YES / NO BUTTONS ── */
.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.choice-row.single { grid-template-columns: 1fr; }

.btn-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 22px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  text-align: center;
}
.btn-choice:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.btn-choice .choice-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
}
.btn-choice .choice-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-choice.yes-btn {
  border-color: rgba(200,80,42,0.3);
  background: var(--primary-lt);
}
.btn-choice.yes-btn:hover {
  border-color: var(--primary);
  background: white;
}
.btn-choice.yes-btn .choice-label { color: var(--primary); }

.btn-choice.no-btn {
  border-color: rgba(139,105,20,0.25);
  background: var(--accent-lt);
}
.btn-choice.no-btn:hover {
  border-color: var(--accent);
  background: white;
}
.btn-choice.no-btn .choice-label { color: var(--secondary); }

/* Price specific */
.btn-choice.price-yes-btn {
  border-color: rgba(200,80,42,0.3);
  background: var(--primary-lt);
}
.btn-choice.price-yes-btn:hover {
  border-color: var(--primary);
  background: white;
}
.btn-choice.price-yes-btn .choice-label { color: var(--primary); }

.btn-choice.price-no-btn {
  border-color: rgba(46,125,50,0.25);
  background: #E8F5E9;
}
.btn-choice.price-no-btn:hover {
  border-color: var(--success);
  background: white;
}
.btn-choice.price-no-btn .choice-label { color: var(--success); }

/* ── THANK YOU STATE ── */
.thank-box {
  background: linear-gradient(135deg, var(--primary-lt), var(--accent-lt));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  text-align: center;
}
.thank-box p {
  font-weight: 600;
  color: var(--text-mid);
  font-size: 0.95rem;
}

/* ── FORM ── */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.form-input,
.form-textarea {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  transition: var(--transition);
  outline: none;
}
.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(200,80,42,0.1);
}
.form-input.error { border-color: #D32F2F; }
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }
.form-textarea {
  resize: vertical;
  min-height: 100px;
}
.form-error {
  font-size: 0.78rem;
  color: #D32F2F;
  margin-top: 4px;
  display: none;
}
.form-error.visible { display: block; }

/* ── PRIMARY BUTTON ── */
.btn-primary {
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: var(--transition);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(200,80,42,0.35); }
.btn-primary:hover::before { opacity: 1; }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Loading spinner */
.btn-primary .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
.btn-primary.loading .btn-text { display: none; }
.btn-primary.loading .spinner  { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── WHATSAPP BUTTON ── */
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  margin-top: 12px;
}
.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,211,102,0.35);
  color: white;
}
.btn-whatsapp svg { width: 22px; height: 22px; fill: white; flex-shrink: 0; }

/* ── SUCCESS STATE ── */
.success-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.success-icon svg { width: 36px; height: 36px; fill: white; }
@keyframes successPop {
  0%   { transform: scale(0); opacity: 0; }
  80%  { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 10px;
}
.success-body {
  font-size: 0.92rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.7;
}
.success-body strong { color: var(--primary); }

/* ── FOOTER ── */
.page-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── PRICE BADGE ── */
.price-badge {
  display: inline-block;
  background: var(--accent-lt);
  color: var(--secondary);
  border: 1px solid rgba(139,105,20,0.25);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ────────────────────────────────
   ADMIN PANEL STYLES
   ──────────────────────────────── */
.admin-wrapper {
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  z-index: 1;
}

/* Admin Login */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.admin-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}
.admin-login-card .card-top-bar {
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
}
.admin-login-body {
  padding: 36px 36px 32px;
}
.admin-login-body .step-label { margin-bottom: 4px; }
.admin-login-body .step-title { font-size: 1.4rem; margin-bottom: 6px; }
.admin-login-body .step-sub   { margin-bottom: 22px; }

/* Admin Nav */
.admin-nav {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-nav-brand .brand-logo-icon { width: 36px; height: 36px; border-radius: 8px; }
.admin-nav-brand .brand-logo-icon svg { width: 20px; height: 20px; }
.admin-nav-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}
.admin-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--primary);
  color: white;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
}
.btn-logout {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-mid);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { border-color: var(--primary); color: var(--primary); }

/* Admin Content */
.admin-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-card.accent .stat-number { color: var(--secondary); }
.stat-card.success .stat-number { color: var(--success); }

/* Table Section */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn.active, .filter-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-export {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-mid);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-export:hover { border-color: var(--secondary); color: var(--secondary); }
.btn-export svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

/* Table */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.leads-table {
  width: 100%;
  border-collapse: collapse;
}
.leads-table thead {
  background: var(--bg-muted);
}
.leads-table th {
  padding: 13px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.leads-table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: var(--text-dark);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.leads-table tr:last-child td { border-bottom: none; }
.leads-table tbody tr {
  transition: background 0.15s;
}
.leads-table tbody tr:hover { background: var(--bg-muted); }

/* Lead Type Badge */
.lead-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.lead-badge.restaurant-yes   { background: #FDECEA; color: #C62828; }
.lead-badge.different-platform { background: #E8F5E9; color: #2E7D32; }
.lead-badge.no-vote           { background: var(--accent-lt); color: var(--secondary); }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state p { font-size: 0.9rem; }

/* Loading */
.table-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.table-loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

/* Responsive table on mobile */
@media (max-width: 768px) {
  .leads-table thead { display: none; }
  .leads-table, .leads-table tbody, .leads-table tr, .leads-table td { display: block; width: 100%; }
  .leads-table tr { border-bottom: 2px solid var(--border); padding: 12px 0; }
  .leads-table td {
    padding: 6px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    border-bottom: none;
  }
  .leads-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    min-width: 90px;
    flex-shrink: 0;
  }
  .admin-content { padding: 20px 16px; }
}

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .card-body { padding: 28px 22px 24px; }
  .step-title { font-size: 1.3rem; }
  .choice-row { grid-template-columns: 1fr; }
  .btn-choice { padding: 18px 14px; flex-direction: row; justify-content: flex-start; gap: 12px; }
  .btn-choice .choice-hint { display: none; }
  .page-wrapper { padding: 20px 12px; }
  .admin-nav { padding: 0 16px; }
  .admin-nav-title { font-size: 0.95rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .step-title { font-size: 1.2rem; }
  .card-body  { padding: 24px 18px; }
}
