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

:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --bg: #faf9f7;
  --card: #ffffff;
  --line: #e9e5dc;
  --accent: #1f6f5c;
  --accent-dark: #163f36;
  --accent-ink: #ffffff;
  --danger: #b3432b;
  --star: #d9a441;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20,20,20,0.04), 0 1px 1px rgba(20,20,20,0.03);
  --shadow-md: 0 10px 30px rgba(18,61,49,0.08), 0 2px 6px rgba(18,61,49,0.05);
  --shadow-lift: 0 14px 34px rgba(18,61,49,0.14), 0 4px 10px rgba(18,61,49,0.08);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 40px 20px; }
.wrap.wide { max-width: 860px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}

h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-family: var(--font-body); font-weight: 700; font-size: 1.05rem; margin: 28px 0 12px; }
p.sub { color: var(--muted); margin-top: 0; font-size: 0.98rem; }

label { display: block; font-size: 0.83rem; font-weight: 600; margin: 16px 0 6px; color: #333; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=tel], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select { cursor: pointer; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31,111,92,0.12);
}
textarea { resize: vertical; min-height: 100px; }

button, .btn {
  display: inline-block;
  background: linear-gradient(180deg, #24816b, var(--accent) 70%);
  color: var(--accent-ink);
  border: none;
  padding: 13px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  margin-top: 18px;
  box-shadow: 0 1px 2px rgba(18,61,49,0.15);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); filter: brightness(1.03); }
button:active, .btn:active { transform: translateY(0); }
.btn.secondary { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); box-shadow: none; }
.btn.secondary:hover { background: rgba(31,111,92,0.06); }
.btn.block { display: block; width: 100%; text-align: center; }

a { color: var(--accent); }
.error { background: #fbeceb; color: var(--danger); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; }
.success { background: #e8f4ee; color: var(--accent-dark); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.9rem; }

.stars { display: flex; justify-content: center; gap: 10px; margin: 28px 0; flex-wrap: wrap; }
.stars form { margin: 0; }
.star-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 74px;
  min-height: 64px;
  padding: 10px 6px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  margin: 0;
}
.star-btn-icon { color: #c9c3b6; letter-spacing: 1px; line-height: 1; transition: color 0.15s ease; }
.star-btn-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s ease;
}
.star-btn:hover, .star-btn:focus-visible {
  border-color: var(--star);
  background: #fdf6e8;
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.star-btn:hover .star-btn-icon, .star-btn:focus-visible .star-btn-icon { color: var(--star); }
.star-btn:hover .star-btn-label, .star-btn:focus-visible .star-btn-label { color: #916300; }
.star-btn:active { transform: translateY(0) scale(0.97); }

.center { text-align: center; }
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge.trial { background: #fff3d6; color: #916300; }
.badge.active { background: #e0f0e9; color: var(--accent-dark); }
.badge.expired, .badge.cancelled, .badge.past_due { background: #fbeceb; color: var(--danger); }
.badge.lifetime { background: #123d31; color: #fff; }
.badge.qualified { background: #fff3d6; color: #916300; }
.badge.approved { background: #e0f0e9; color: var(--accent-dark); }
.badge.rejected { background: #fbeceb; color: var(--danger); }
.badge.paid { background: #e0f0e9; color: var(--accent-dark); }

.promo-banner {
  background: #fff3d6;
  border: 1px solid #f0d99a;
  color: #7a5a00;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.promo-banner form { margin: 0; }
.promo-banner button {
  margin-top: 12px;
  background: linear-gradient(180deg, #e2b542, var(--star) 70%);
}

.tip-card { background: linear-gradient(135deg, #fbf8f2, var(--card)); }
.tip-of-day {
  margin: 14px 0 0;
  padding: 16px 18px;
  background: #fff;
  border-left: 4px solid var(--star);
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
  line-height: 1.5;
}

table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 700; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr:hover { background: rgba(31,111,92,0.035); }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.topbar a.logout { font-size: 0.85rem; color: var(--muted); }
.qr-box { text-align: center; padding: 20px; border: 1px dashed var(--line); border-radius: var(--radius); }
.small { font-size: 0.82rem; color: var(--muted); }
.rating-star-icon { color: var(--star); }

.logo-header { text-align: center; margin-bottom: 26px; }
.logo-header img { height: 68px; width: auto; }

.site-footer {
  text-align: center;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}
.site-footer a { color: var(--muted); text-decoration: none; margin: 0 4px; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer span { color: var(--line); }
.legal h2 { margin-top: 26px; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 20px; }

/* Stat tiles - dashboard metrics */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-top: 16px; }
.stat-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--bg);
}
.stat-tile .stat-icon { font-size: 1.3rem; margin-bottom: 8px; }
.stat-tile .stat-value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; line-height: 1; }
.stat-tile .stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 6px; font-weight: 500; }

/* Feedback feed - replaces plain table for private feedback */
.feedback-feed { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.feedback-item {
  border: 1px solid var(--line);
  border-left: 4px solid var(--star);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  background: var(--bg);
}
.feedback-item.rating-1, .feedback-item.rating-2 { border-left-color: var(--danger); }
.feedback-item .fb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.feedback-item .fb-loc { font-weight: 600; font-size: 0.9rem; }
.feedback-item .fb-meta { color: var(--muted); font-size: 0.78rem; }
.feedback-item .fb-msg { margin-top: 8px; font-size: 0.92rem; }
.feedback-item .fb-contact { margin-top: 6px; font-size: 0.8rem; color: var(--muted); }

/* Empty state */
.empty-state { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty-state .empty-icon { font-size: 1.8rem; margin-bottom: 8px; }

/* Split auth layout (login / register) */
.auth-shell { min-height: 100vh; display: flex; }
.auth-visual {
  flex: 1;
  background: radial-gradient(circle at 20% 20%, #2c8a72, var(--accent-dark) 75%);
  color: #fff;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-visual .auth-tagline {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 22ch;
}
.auth-visual .auth-sub { color: rgba(255,255,255,0.75); margin-top: 16px; max-width: 34ch; font-size: 0.95rem; }
.auth-visual .auth-logo-text { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: #fff; }
.auth-visual .auth-logo-text span { color: var(--star); }
.auth-visual .auth-quote { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.auth-form-col { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-form-col .wrap { padding: 0; }
.auth-mobile-logo { display: none; text-align: center; margin-bottom: 24px; }
.auth-mobile-logo img { height: 56px; width: auto; }
@media (max-width: 860px) {
  .auth-visual { display: none; }
  .auth-mobile-logo { display: block; }
}

.phone-row { display: flex; gap: 8px; }
.phone-row select { flex: 0 0 128px; }
.phone-row input { flex: 1; min-width: 0; }

.otp-boxes { display: flex; gap: 10px; justify-content: center; margin: 24px 0 14px; }
.otp-box {
  width: 46px !important;
  height: 56px;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 0 !important;
}
