/* =====================================================================
 *  Bengal Photographers — marketplace UI
 *  Shares the WBPWA navy / gold palette.
 * ===================================================================== */

:root {
  --navy: #142850;
  --navy-soft: #1c2f5a;
  --ink: #1c2536;
  --muted: #6b7280;
  --gold: #e0af27;
  --gold-dark: #b8891a;
  --line: #e5e7eb;
  --bg: #f5f7fb;
  --card: #ffffff;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 12px;
  --shadow: 0 6px 22px rgba(20, 40, 80, 0.08);
}

* { box-sizing: border-box; }

/* The `hidden` attribute must win over every component rule below
   (.auth-wrap, .auth-form, .toast ... all set an explicit display),
   otherwise login/register panels stay painted after signing in. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Poppins", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

h1, h2, h3, h4 { font-family: inherit; color: var(--navy); margin: 0 0 8px; line-height: 1.3; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
a { color: var(--gold-dark); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px; padding: 9px 16px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
  background: #eef1f6; color: var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-soft); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: #fef2f2; color: var(--bad); border-color: #fecaca; }
.btn-ok { background: #ecfdf5; color: #14663a; border-color: #bbe7d0; }
.btn-ok:hover { background: #14663a; color: #fff; border-color: #14663a; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- auth shell (header + sidebar + card) ---------------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(1000px 500px at 15% -10%, rgba(224,175,39,.18), transparent 60%),
    linear-gradient(160deg, #142850 0%, #1c2f5a 60%, #22406f 100%);
}

.auth-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 26px;
  background: rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(6px);
}
.auth-head-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.auth-head-logo {
  width: 42px; height: 42px; border-radius: 11px;
  background: #fff; color: var(--navy);
  display: grid; place-items: center; font-size: 21px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.auth-head-brand strong { display: block; font-size: 16px; line-height: 1.2; }
.auth-head-brand small { color: rgba(255,255,255,.66); font-size: 11.5px; }
.auth-head-nav { margin-left: auto; display: flex; gap: 20px; }
.auth-head-nav a {
  color: rgba(255,255,255,.8); text-decoration: none; font-size: 13.5px; font-weight: 600;
  transition: color .15s ease;
}
.auth-head-nav a:hover { color: var(--gold); }

.auth-body {
  display: grid;
  grid-template-columns: 1fr 460px;
  align-items: stretch;
  max-width: 1320px; width: 100%; margin: 0 auto;
}

/* ---- left sidebar ---- */
.auth-side {
  padding: 54px 46px;
  color: #fff;
  display: flex; flex-direction: column; justify-content: center; gap: 22px;
}
.auth-side h2 { color: #fff; font-size: 34px; line-height: 1.22; margin: 0; }
.auth-side h2 .gold { color: var(--gold); }
.auth-side-lead { color: rgba(255,255,255,.76); font-size: 15px; max-width: 46ch; margin: 0; }

.auth-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.auth-feats li { display: flex; gap: 13px; align-items: flex-start; }
.auth-feats li > span {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.1); display: grid; place-items: center; font-size: 17px;
}
.auth-feats b { display: block; font-size: 14px; color: #fff; }
.auth-feats small { color: rgba(255,255,255,.65); font-size: 12.5px; line-height: 1.45; }

.auth-side-steps {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px; padding: 16px 18px;
}
.auth-side-steps b { display: block; color: var(--gold); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 9px; }
.auth-side-steps ol { margin: 0; padding-left: 18px; color: rgba(255,255,255,.82); font-size: 13px; display: grid; gap: 5px; }

/* ---- right card ---- */
.auth-card {
  background: #fff; border-radius: 20px 0 0 20px;
  box-shadow: -18px 0 60px rgba(0,0,0,.3);
  padding: 40px 38px 32px;
  display: flex; flex-direction: column; justify-content: center;
  margin: 34px 34px 34px 0;
}
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-logo {
  width: 62px; height: 62px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--navy); color: var(--gold); display: grid; place-items: center; font-size: 28px;
}
.auth-brand h1 { font-size: 22px; margin-bottom: 2px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 13.5px; }
.beta-badge {
  display: inline-block; margin-top: 9px; padding: 3px 11px; border-radius: 999px;
  background: #fef3c7; color: #92400e; font-size: 11.5px; font-weight: 700; letter-spacing: .03em;
}
.auth-tabs { display: flex; gap: 6px; background: #f1f3f8; padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 8px;
  font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--navy); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.auth-form { display: grid; gap: 12px; }
.auth-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--navy); }
.auth-form input, .auth-form select, .auth-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff;
}
.auth-form input:focus, .auth-form select:focus, .auth-form textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20,40,80,.1);
}
.auth-err { color: var(--bad); font-size: 13px; margin: 0; min-height: 18px; }
.auth-note { color: var(--muted); font-size: 12.5px; margin: 0; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin: 16px 0 0; }

/* Stack the shell on narrow screens: header stays on top, the sidebar
   becomes a compact intro above the card, and the card goes full width. */
@media (max-width: 900px) {
  .auth-body { grid-template-columns: 1fr; }
  .auth-side { padding: 34px 22px 6px; gap: 16px; }
  .auth-side h2 { font-size: 26px; }
  .auth-feats { grid-template-columns: 1fr 1fr; }
  .auth-card {
    border-radius: 18px; margin: 22px 16px 30px;
    box-shadow: 0 18px 44px rgba(0,0,0,.28); padding: 30px 24px 26px;
  }
  .auth-head { padding: 12px 16px; gap: 12px; }
  .auth-head-nav { gap: 14px; }
}
@media (max-width: 560px) {
  .auth-head-nav a:not(:last-child) { display: none; }
  .auth-feats { grid-template-columns: 1fr; }
  .auth-side { padding-bottom: 0; }
}

/* ---------------- header ---------------- */
.mp-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: var(--shadow); }
.mp-head-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.mp-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.mp-logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; font-size: 20px; }
/* an admin-set logo image inside any of the three brand slots */
[data-brand-logo] { overflow: hidden; }
[data-brand-logo] img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.mp-brand strong { display: block; font-size: 16px; }
.mp-brand small { color: rgba(255,255,255,.68); font-size: 11.5px; }
.mp-user { display: flex; align-items: center; gap: 10px; font-size: 13.5px; flex-wrap: wrap; }
.mp-user .btn-ghost { color: #fff; border-color: rgba(255,255,255,.28); }
.mp-user .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.role-chip {
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--gold); color: var(--navy);
}

.mp-nav { max-width: 1180px; margin: 0 auto; padding: 0 10px; display: flex; gap: 2px; overflow-x: auto; }
.mp-nav button {
  border: 0; background: transparent; color: rgba(255,255,255,.75); font: inherit; font-weight: 600;
  font-size: 13.5px; padding: 11px 14px; cursor: pointer; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.mp-nav button:hover { color: #fff; }
.mp-nav button.active { color: #fff; border-bottom-color: var(--gold); }

/* ---------------- layout ---------------- */
.mp-main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.view-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border: 1px solid rgba(20,40,80,.06);
}
.card + .card { margin-top: 0; }
.card h3 { margin-bottom: 10px; }

.stat { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); border: 1px solid rgba(20,40,80,.06); }
.stat .k { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.stat.accent .k { color: var(--gold-dark); }
.stat.warn .k { color: var(--warn); }
.stat.ok .k { color: var(--ok); }
.stat.bad .k { color: var(--bad); }

/* Status chips for the member master data & membership cards.  The
   marketplace page does not load admin.css, so these are redeclared
   here in the marketplace's own variables — same three-state reading. */
.dm-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
  background: #eef1f6; color: #475569; white-space: nowrap;
}
.dm-badge.ok   { background: #e8f7ee; color: #14663a; }
.dm-badge.warn { background: #fff4e5; color: #8a4b08; }
.dm-badge.bad  { background: #fdeaea; color: #8f1d1d; }
.dm-badge.quiet{ background: #eef1f6; color: #475569; }

/* ---------------- forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.field { display: grid; gap: 5px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.field .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(20,40,80,.1);
}
.field.span-2 { grid-column: span 2; }
@media (max-width: 520px) { .field.span-2 { grid-column: span 1; } }
.fieldset-title { font-size: 13px; font-weight: 700; color: var(--gold-dark); text-transform: uppercase; letter-spacing: .05em; margin: 6px 0 2px; grid-column: 1/-1; }

.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }

/* ---------------- price box ---------------- */
.price-box {
  background: linear-gradient(135deg, #142850, #22406f); color: #fff;
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.price-box .amount { font-size: 28px; font-weight: 700; color: var(--gold); }
.price-box .lbl { font-size: 12.5px; color: rgba(255,255,255,.72); }
.price-box table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12.5px; }
.price-box td { padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.16); color: rgba(255,255,255,.88); }
.price-box td:last-child { text-align: right; white-space: nowrap; }

/* ---------------- lists ---------------- */
.list { display: grid; gap: 12px; }
.row {
  background: #fff; border: 1px solid rgba(20,40,80,.08); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); display: grid; gap: 10px;
}
.row-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.row-title { font-weight: 700; color: var(--navy); font-size: 15px; }
.row-meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-body { font-size: 13.5px; }

.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: #eef1f6; color: var(--muted);
}
.badge.open, .badge.quoting { background: #dbeafe; color: #1d4ed8; }
.badge.confirmed, .badge.approved, .badge.active, .badge.accepted, .badge.sent { background: #dcfce7; color: #15803d; }
.badge.pending, .badge.submitted, .badge.viewed, .badge.in_progress { background: #fef3c7; color: #92400e; }
.badge.completed, .badge.won { background: #d1fae5; color: #065f46; }
.badge.cancelled, .badge.rejected, .badge.expired, .badge.lost, .badge.suspended, .badge.withdrawn { background: #fee2e2; color: #b91c1c; }
.badge.flagged, .badge.pending_review, .badge.disputed { background: #ffedd5; color: #9a3412; }

.privacy-note {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 11px 14px; font-size: 13px;
}
.privacy-note strong { display: block; margin-bottom: 2px; }
.info-note {
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
  border-radius: 10px; padding: 11px 14px; font-size: 13px;
}

/* ---------------- chat ---------------- */
.chat { display: grid; grid-template-rows: auto 1fr auto; height: min(60vh, 520px); background: #fff; border-radius: var(--radius); border: 1px solid rgba(20,40,80,.08); box-shadow: var(--shadow); overflow: hidden; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); background: #f9fafc; }
.chat-head .t { font-weight: 700; color: var(--navy); font-size: 14px; }
.chat-head .w { font-size: 11.5px; color: var(--warn); margin-top: 2px; }
.chat-log { overflow-y: auto; padding: 16px; display: grid; gap: 10px; align-content: start; background: #fafbfd; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.bubble .who { font-size: 11px; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.bubble .when { font-size: 10.5px; opacity: .55; margin-top: 3px; }
.bubble.mine { justify-self: end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.bubble.theirs { justify-self: start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.system { justify-self: center; background: #fffbeb; color: #92400e; border: 1px solid #fde68a; font-size: 12.5px; text-align: center; }
.bubble.held { border: 1px dashed var(--warn); background: #fff7ed; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.chat-input input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

.empty { text-align: center; padding: 38px 18px; color: var(--muted); font-size: 13.5px; }
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; }

.mp-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.28); font-size: 13.5px; z-index: 100; max-width: 90vw;
}
.mp-toast.ok { background: var(--ok); }
.mp-toast.bad { background: var(--bad); }

/* ---------------- modal ---------------- */
.mp-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 40, 80, .55); backdrop-filter: blur(2px);
  display: grid; place-items: center; padding: 20px 14px;
}
.mp-modal-card {
  width: min(680px, 100%); max-height: 86vh; overflow: hidden;
  background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.3);
  display: grid; grid-template-rows: auto 1fr;
}
.mp-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line); background: #f9fafc;
}
.mp-modal-head h3 { margin: 0; font-size: 16px; }
.mp-modal-x {
  border: 0; background: transparent; font-size: 20px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.mp-modal-x:hover { background: #eef1f6; color: var(--bad); }
.mp-modal-body { padding: 18px; overflow-y: auto; }
.mp-modal-body h3 { margin-top: 16px; font-size: 14px; }
.mp-modal-body ul { margin: 6px 0 0; padding-left: 18px; }
.mp-modal-body .row-actions { margin-top: 14px; }
@media (max-width: 520px) {
  .mp-modal-card { max-height: 92vh; }
  .mp-modal-body { padding: 14px; }
}

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; color: var(--ink); }

.tbl-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: #f9fafc; color: var(--navy); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:hover td { background: #fafbfd; }
table.data td.wrap { white-space: normal; min-width: 180px; }

.sep { height: 1px; background: var(--line); margin: 14px 0; }
.mt { margin-top: 14px; }
.right { text-align: right; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.gold { color: var(--gold-dark); font-weight: 700; }

/* ---------------- rating & reviews ---------------- */
.stars { color: var(--gold); letter-spacing: 1px; font-size: 14px; }
.rating-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.rating-chip.muted { color: var(--muted); font-weight: 500; }
.rating-chip .rc-count { color: var(--muted); font-weight: 500; }

.star-input { display: flex; gap: 4px; margin-top: 8px; }
.star-btn {
  background: none; border: 0; padding: 2px 4px; cursor: pointer;
  font-size: 30px; line-height: 1; color: #d7dbe3;
  transition: color .12s ease, transform .12s ease;
}
.star-btn:hover { transform: scale(1.12); color: #f0d47a; }
.star-btn.on { color: var(--gold); }
.star-btn:focus-visible { outline: 2px solid var(--gold-dark); outline-offset: 2px; border-radius: 6px; }

.review {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.review-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.review-top b { font-size: 14px; color: var(--navy); }
.review-top .who {
  display: inline-block; margin-left: 6px; font-size: 11px;
  background: #eef1f6; color: var(--muted); padding: 1px 7px; border-radius: 999px;
}
.review-score { white-space: nowrap; font-size: 13px; }
.review-body { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; }
.review-reply {
  margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--gold);
  background: #fdf8ec; border-radius: 0 8px 8px 0;
}
.review-reply b { font-size: 11.5px; color: var(--gold-dark); display: block; margin-bottom: 2px; }
.review-reply p { margin: 0; font-size: 13px; line-height: 1.5; }
.review-actions { margin-top: 10px; }

@media (max-width: 640px) {
  .mp-main { padding: 16px 12px 50px; }
  .card { padding: 15px; }
  .bubble { max-width: 88%; }
  .star-btn { font-size: 26px; }
}
