/* main.css — shared base styles + components used across multiple pages */

/* ── Brand palette (2026-06-30 rebrand: "Social Ad Builder" → Tangaza
   Studio) — mixed from the Shangazi Online mark (orange) and the
   Tangaza Studio mark (near-black + red). --primary replaces the old
   --blue everywhere (same variable role: primary actions, active
   states, links); kept the var name change scoped to a clean rename
   rather than aliasing, since usage sites were all in main.css/
   builder.css and easy to re-point. --orange is now a deeper amber so
   "pending" status badges don't visually compete with the brand-orange
   primary color. --red shifted slightly to match the Tangaza red. */
:root {
  --primary: #f2900e;       /* Shangazi orange — primary actions, links, active states */
  --primary-rgb: 242, 144, 14;
  --primary-dark: #c6740a;  /* hover/active shade of primary */
  --ink: #15161a;           /* Tangaza near-black — headings, dark UI accents */
  --accent: #e2231a;        /* Tangaza red — sparing use: highlights, brand accents */
  --accent-rgb: 226, 35, 26;
  --green: #1f9d55;
  --orange: #b45309;        /* status amber (pending), distinct from --primary */
  --red: #d92d20;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-900: #111827;
  --font: "Nunito", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: #fff;
  margin: 0;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

/* ── Brand lockup (logo + wordmark) ──
   Used wherever the app's identity is shown: index.html hero,
   auth.html card, dashboard.html topbar, and a slim bar above the
   page heading on payment/schedule/admin. .brand-lockup-sm is the
   compact icon-only variant for tight toolbars (builder.html,
   admin-review.html topbars). */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-lockup img {
  height: 32px;
  width: auto;
  display: block;
}

.brand-lockup-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.01em;
}

.brand-lockup-tagline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-top: 1px;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-100);
}

.brand-lockup-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.brand-lockup-sm img {
  height: 22px;
  width: auto;
  display: block;
}

.page-heading {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}

.page-sub {
  font-size: 14px;
  color: var(--gray-600);
  margin: 0 0 20px;
}

/* ── Tier selector (payment.html Step 1) ── */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .tier-grid { grid-template-columns: 1fr; }
}

.tier-card {
  border: 2px solid var(--gray-200);
  border-radius: 14px;
  padding: 20px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}

.tier-card:hover { border-color: var(--primary); }

.tier-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.12);
}

.tier-card h3 { margin: 0 0 8px; font-size: 17px; }
.tier-card p { font-size: 13px; color: var(--gray-600); margin: 0 0 12px; }
.tier-card ul { list-style: none; padding: 0; margin: 0 0 16px; font-size: 13px; }
.tier-card li { margin-bottom: 6px; }
.tier-card li.no { color: var(--gray-400); }

/* ── Plan cards (Step 2) ── */
.plan-group { display: none; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}

@media (max-width: 720px) {
  .plan-grid { grid-template-columns: 1fr; }
}

.plan-card {
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  text-align: center;
}

.plan-card.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),0.12); }
.plan-card .plan-name { font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.plan-card .plan-price { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.plan-card .plan-meta { font-size: 12px; color: var(--gray-600); }

/* ── Payment instructions box ── */
.paybill-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 18px;
  margin: 18px 0;
}

.pb-title { font-weight: 800; font-size: 14px; margin: 0 0 12px; }

/* ── Payment method logo badges (M-Pesa / Airtel Money) ──
   Drop real files at assets/icons/mpesa-logo.png and
   assets/icons/airtel-money-logo.png — until then this falls back
   to a plain text badge automatically (see onerror in payment.html). */
.pb-methods {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.pb-method-badge img {
  height: 28px;
  display: block;
}

.pb-method-fallback {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--gray-900);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.pb-step {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.pb-num {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 14px;
  resize: vertical;
}
.field-error { display: none; color: var(--red); font-size: 12px; margin-top: 4px; }

.warning-banner {
  display: none;
  background: #fef2f2;
  border: 2px solid var(--red);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  font-size: 13px;
  color: #b91c1c;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-success { background: var(--green); color: #fff; width: 100%; }
.btn-outline { background: #fff; border: 1.5px solid var(--gray-200); color: var(--gray-900); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Pending / submitted confirmation screen ── */
.status-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #fff7ed;
  color: var(--orange);
  border: 1px solid #fed7aa;
}

/* ── Toasts (no native alert()) ── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: toast-in .2s ease;
}

.toast-info { background: var(--primary); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Admin payment confirmation queue (admin.html) ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-200);
}

.data-table th {
  background: var(--gray-50);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--gray-600);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-pending { background: #fff7ed; color: var(--orange); }
.badge-confirmed { background: #ecfdf5; color: var(--green); }
.badge-rejected { background: #fef2f2; color: var(--red); }

/* ── Filter tabs (Design Review Queue, admin.html) ── */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-tab {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Auth screen (auth.html) ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}

.auth-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.auth-sub {
  font-size: 13px;
  color: var(--gray-600);
  text-align: center;
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 22px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--gray-600);
  background: transparent;
  border: none;
  font-family: var(--font);
}

.auth-tab.active { background: var(--primary); color: #fff; }

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-error {
  display: none;
  background: #fef2f2;
  border: 1.5px solid var(--red);
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  font-size: 12px;
  color: var(--gray-400);
}


.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

/* ── Site footer (all pages) ── */
.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  padding: 32px 24px 40px;
}
.site-footer .sep { margin: 0 10px; color: var(--gray-200); }
.site-footer a { color: var(--gray-600); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--primary); }

/* ── Help & Contact page (.hc-*) ── */
.hc-hero {
  background: #fff;
  color: var(--ink);
  padding-bottom: 90px;
}
.hc-hero .brand-bar {
  border-bottom: 1px solid var(--gray-100);
  margin: 0;
  padding: 24px 32px;
}
.hc-hero h1 {
  font-size: 40px;
  font-weight: 800;
  margin: 56px 0 0;
  padding: 0 32px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  color: var(--ink);
}
.hc-wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px 60px; }
.hc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: -56px;
  position: relative;
  z-index: 2;
}
.hc-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
}
.hc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  padding: 8px;
}
.hc-card-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hc-card h3 { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.hc-card p { font-size: 13px; color: var(--gray-600); margin: 0 0 12px; line-height: 1.5; }
.hc-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--gray-100);
  font-size: 13px;
  color: var(--gray-600);
  text-decoration: none;
}
.hc-card-row:hover { color: var(--primary); }
.hc-faq { margin-top: 48px; }
.hc-faq h2 { font-size: 22px; font-weight: 800; margin-bottom: 16px; }
.hc-faq-item { border-top: 1px solid var(--gray-200); padding: 16px 0; }
.hc-faq-item strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.hc-faq-item p { font-size: 13px; color: var(--gray-600); margin: 0; line-height: 1.6; }

/* ── Done For You — brief.html (.brief-*) ── */
.brief-hero {
  background: #fff;
  color: var(--ink);
  padding-bottom: 60px;
}
.brief-hero-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 32px 0;
}
.brief-hero-label {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.brief-hero h1 {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--ink);
}
.brief-hero p {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.6;
  margin: 0;
}

.brief-wrap { max-width: 800px; }

/* How it works steps */
.brief-steps {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 28px 0 24px;
}
.brief-step {
  flex: 1;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.brief-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brief-step-text { font-size: 13px; color: var(--gray-600); line-height: 1.5; }
.brief-step-arrow { color: var(--gray-400); font-size: 18px; padding-top: 4px; }

/* Brief card */
.brief-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 32px;
}
.brief-card-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 20px;
}
.brief-section-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--gray-100);
}
.brief-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 560px) {
  .brief-row { grid-template-columns: 1fr; }
  .brief-steps { flex-direction: column; }
  .brief-step-arrow { display: none; }
}

/* Style selector */
.brief-style-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.brief-style-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s, background .15s, color .15s;
}
.brief-style-btn:hover { border-color: var(--primary); color: var(--primary); }
.brief-style-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Upload zone */
.brief-upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  position: relative;
}
.brief-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.brief-upload-zone:hover, .brief-upload-zone.drag-over {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), .04);
}
.brief-upload-icon { font-size: 24px; margin-bottom: 8px; }
.brief-upload-zone p { margin: 4px 0; font-size: 14px; color: var(--gray-600); }

/* Reference thumbnails */
.brief-preview-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.brief-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
}
.brief-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brief-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Deposit box */
.brief-deposit-box {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}
.brief-deposit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.brief-deposit-header strong { font-size: 15px; font-weight: 800; }
.brief-deposit-header p { font-size: 13px; color: var(--gray-600); margin: 4px 0 0; line-height: 1.5; }
.brief-deposit-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
}

/* Submit button */
.brief-submit { width: 100%; font-size: 15px; height: 48px; }

/* Error / success */
.brief-error {
  background: #fef2f2;
  border: 1.5px solid var(--red);
  color: #b91c1c;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.brief-success {
  padding: 0;
}
.brief-submitted {
  text-align: center;
  padding: 40px 24px;
}
.brief-submitted-icon { font-size: 48px; margin-bottom: 16px; }
.brief-submitted h2 { font-size: 24px; font-weight: 800; margin: 0 0 12px; }
.brief-submitted p { color: var(--gray-600); font-size: 14px; line-height: 1.6; margin: 0 0 8px; }

/* Done For You — admin briefs queue (.dfyq-*) */
.dfyq-status-submitted   { background: #eff6ff; color: #1d4ed8; }
.dfyq-status-in_progress { background: #fff7ed; color: var(--orange); }
.dfyq-status-preview_ready { background: #ecfdf5; color: var(--green); }
.dfyq-status-paid        { background: #f0fdf4; color: #15803d; }
.dfyq-status-rejected    { background: #fef2f2; color: var(--red); }

/* Done For You — preview.html (.pv-*) */
.pv-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.pv-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.pv-title { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.pv-sub   { font-size: 14px; color: var(--gray-600); margin: 0 0 24px; }
.pv-canvas-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--gray-200);
  margin-bottom: 24px;
  background: var(--gray-50);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-canvas-wrap canvas { display: block; max-width: 100%; border-radius: 10px; }
.pv-loading { color: var(--gray-400); font-size: 14px; padding: 48px 0; }
.pv-cta-card {
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}
.pv-cta-card h3 { font-size: 18px; font-weight: 800; margin: 0 0 8px; color: #fff; }
.pv-cta-card p { font-size: 13px; color: rgba(255,255,255,.7); margin: 0 0 20px; line-height: 1.5; }
.pv-cta-card .btn { width: 100%; height: 48px; font-size: 15px; }
.pv-not-ready {
  text-align: center;
  padding: 60px 24px;
  color: var(--gray-600);
}
.pv-not-ready h2 { font-size: 22px; font-weight: 800; margin: 0 0 12px; color: var(--ink); }

/* ── Auth link button (Forgot your password / Back to Sign In) ── */
.auth-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  padding: 0;
}
.auth-link:hover { color: var(--primary-dark); }
