/* Vava Maps — account & transaction styles.
   Components for the pages that hang off the search screen: Register/Login,
   Request Quote, Express Interest, My Activity, Notification center, plus the
   header notification bell and the deep-link banner used back on the map.

   Theme-neutral: every colour/radius/shadow is a core.css custom property, so
   theme2.css (Warm Sand) reskins these automatically. Load order per page:
   core.css -> theme2.css -> account.css. */

/* ---------- standalone page shell (these pages scroll, unlike .app) ---------- */
.acct-header { position: sticky; top: 0; z-index: 30; }

/* top-panel language selector — custom flag dropdown (inserted by i18n.js into .header-actions) */
.lng { position: relative; }
.lng__btn {
  height: 36px; display: inline-flex; align-items: center; gap: 7px;
  padding: 0 9px; border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius-sm); color: var(--text-soft); font-size: 13px;
  font-weight: 600; font-family: inherit; cursor: pointer; max-width: 170px;
}
.lng__btn:hover { border-color: var(--border-strong); color: var(--text); }
.lng__btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lng__code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lng__flag {
  width: 20px; height: 14px; flex: none; overflow: hidden; border-radius: 2px;
  display: inline-flex; box-shadow: 0 0 0 1px rgba(15, 23, 42, .08);
}
.lng__flag svg { width: 100%; height: 100%; display: block; }
.lng__chev { width: 14px; height: 14px; flex: none; color: var(--text-mute); }
.lng__menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 1100;
  margin: 0; padding: 5px; list-style: none; min-width: 172px; max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
.lng__opt {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border: 0; background: transparent; border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px; font-weight: 600; text-align: left; cursor: pointer;
}
.lng__opt:hover { background: var(--surface-2); }
.lng__opt[aria-selected="true"] { color: var(--primary); }
.acct-main {
  max-width: 960px; margin: 0 auto; padding: 26px var(--pad) 64px;
}
.acct-wrap { max-width: 560px; margin: 0 auto; }
.acct-wrap--wide { max-width: 820px; }

.page-head { margin-bottom: 18px; }
.page-head h1 { margin: 0 0 4px; font-size: 22px; font-family: var(--font-head); letter-spacing: -.3px; }
.page-head p { margin: 0; color: var(--text-soft); font-size: 13.5px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  background: none; border: 0; color: var(--text-soft); font-weight: 600; font-size: 13px; padding: 0;
}
.back:hover { color: var(--primary); }
.back svg { width: 15px; height: 15px; }

/* profile chip: circular initials avatar stacked above a "Me" label */
.who { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.who__ava {
  width: 28px; height: 28px; border-radius: var(--radius-pill); flex: none;
  display: grid; place-items: center; font-weight: 800; font-size: 11px; color: var(--on-primary);
  background: linear-gradient(150deg, var(--accent), var(--primary));
}
.who__label { font-size: 11px; font-weight: 700; color: var(--text); line-height: 1; }
/* My Activity reads as a plain header link, not a boxed button
   (opt-2's `.btn` re-adds a border, so clear it explicitly here) */
.header-actions .btn[data-href="my-activity.html"] { padding: 0 4px; border-color: transparent; background: transparent; }
.header-actions .btn[data-href="my-activity.html"]:hover { background: transparent; border-color: transparent; color: var(--primary); }

/* ---------- notification bell ---------- */
.bell {
  position: relative; width: 40px; height: 40px; flex: none;
  display: grid; place-items: center; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--text-soft);
}
.bell:hover { color: var(--primary); }
.bell svg { width: 18px; height: 18px; }
.bell__badge {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--radius-pill); background: var(--danger); color: #fff;
  font-size: 10.5px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--surface);
}

/* ---------- cards / panels ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px;
}
.panel + .panel { margin-top: 16px; }

/* ---------- generic top tabs ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-pill); margin-bottom: 16px; }
.tab {
  border: 0; background: transparent; border-radius: var(--radius-pill);
  padding: 7px 16px; font-size: 13px; font-weight: 600; color: var(--text-soft);
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .group__title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.field .hint { font-size: 11.5px; color: var(--text-mute); font-weight: 500; }
.field input, .field select, .field textarea {
  height: 42px; border: 1px solid var(--border-strong); background: var(--surface);
  border-radius: var(--radius-sm); padding: 0 12px; color: var(--text); font-size: 14px;
  font-family: inherit; width: 100%;
}
.field textarea { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.group { border: 0; padding: 0; margin: 0 0 16px; }
.group__title { display: block; margin-bottom: 8px; }

/* role picker (register) — selectable cards backed by a hidden radio */
.role-picker { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.rp { position: relative; display: block; cursor: pointer; }
.rp input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rp-card {
  display: block; height: 100%; padding: 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); transition: border-color .12s, box-shadow .12s, background .12s;
}
.rp-card b { display: block; font-size: 13.5px; }
.rp-card span { display: block; font-size: 11.5px; color: var(--text-soft); margin-top: 2px; }
.rp:hover .rp-card { border-color: var(--primary); }
.rp input:checked + .rp-card { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.rp input:focus-visible + .rp-card { outline: 2px solid var(--focus); outline-offset: 2px; }

/* checkbox rows (terms, triggers) */
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; color: var(--text-soft); margin-bottom: 10px; }
.check input { width: 17px; height: 17px; margin: 1px 0 0; flex: none; accent-color: var(--primary); }
.check a { color: var(--primary); }

.trigger-list { display: flex; flex-direction: column; gap: 2px; }
.trg {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
}
.trg:hover { border-color: var(--border-strong); }
.trg input { width: 17px; height: 17px; flex: none; accent-color: var(--primary); }
.trg b { font-size: 13px; }
.trg span { font-size: 11.5px; color: var(--text-mute); margin-left: auto; }

.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.form-actions .btn { height: 44px; padding: 0 22px; }
.muted-link { background: none; border: 0; color: var(--text-soft); font-weight: 600; font-size: 13px; padding: 0; }
.muted-link:hover { color: var(--primary); }
.form-note { font-size: 12px; color: var(--text-mute); margin-top: 12px; }
.form-note a { color: var(--primary); }

/* ---------- product context card (top of quote / interest) ---------- */
.ctx-card {
  display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; margin-bottom: 18px;
}
.ctx-media { position: relative; overflow: hidden; aspect-ratio: 19 / 11; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.ctx-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ctx-material { font-size: 16px; font-weight: 700; font-family: var(--font-head); letter-spacing: -.2px; }
.ctx-cat { font-size: 11.5px; color: var(--text-mute); font-weight: 600; }
.ctx-company { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-top: 2px; }
.ctx-company b { color: var(--text); }
.ctx-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); flex: none; background: var(--primary); }
.ctx-dot--supplier { background: var(--role-supplier, var(--primary)); }
.ctx-dot--distributor { background: var(--role-distributor, #1f6e74); }
.ctx-dot--fabricator { background: var(--role-fabricator, #8a5a74); }
.ctx-role { margin-left: 2px; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-soft); }
.ctx-role--supplier { color: var(--role-supplier-ink, var(--primary-strong)); background: var(--role-supplier-bg, var(--surface-2)); }
.ctx-role--distributor { color: var(--role-distributor-ink, #14565b); background: var(--role-distributor-bg, var(--surface-2)); }
.ctx-role--fabricator { color: var(--role-fabricator-ink, #6b4357); background: var(--role-fabricator-bg, var(--surface-2)); }
.ctx-loc { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-soft); }
.ctx-loc svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
.ctx-buy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.ctx-price { font-size: 13.5px; font-weight: 700; color: var(--text); }
.ctx-qty { font-size: 12px; color: var(--text-soft); font-weight: 600; }

/* ---------- activity rows (quotes + watches) ---------- */
.activity { display: flex; flex-direction: column; gap: 12px; }
.ar {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 12px;
  transition: box-shadow .14s, border-color .14s, transform .14s;
}
.ar[role="button"] { cursor: pointer; }
.ar[role="button"]:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.ar-media { position: relative; overflow: hidden; aspect-ratio: 19 / 11; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.ar-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ar-title { font-size: 15px; font-weight: 700; font-family: var(--font-head); letter-spacing: -.2px; }
.ar-sub { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-soft); }
.ar-meta { font-size: 12px; color: var(--text-soft); }
.ar-meta b { color: var(--text); font-weight: 600; }
.ar-side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.ar-date { font-size: 11.5px; color: var(--text-mute); white-space: nowrap; }
.ar--watch .ar-side { align-items: stretch; }
.ar--watch .ar-side .btn { justify-content: center; }

.wchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.wchip {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--primary-soft); color: var(--primary-strong);
}

/* status pills (§23.3) */
.status { font-size: 10.5px; font-weight: 800; letter-spacing: .2px; padding: 3px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.status--submitted { background: var(--fresh-recent-bg); color: var(--fresh-recent); }
.status--viewed    { background: var(--fresh-today-bg);  color: var(--fresh-today); }
.status--responded { background: var(--fresh-live-bg);   color: var(--fresh-live); }
.status--info      { background: var(--fresh-aging-bg);  color: var(--fresh-aging); }
.status--closed    { background: var(--fresh-unconf-bg); color: var(--fresh-unconf); }
.status--declined  { background: var(--danger-bg); color: var(--danger); }

.empty { padding: 34px 20px; text-align: center; color: var(--text-soft); font-size: 13.5px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty a { color: var(--primary); }

/* ---------- notification center ---------- */
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif {
  display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 13px 14px; cursor: pointer;
  transition: box-shadow .14s, border-color .14s, transform .14s;
}
.notif:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-1px); }
.notif.is-unread { border-color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.notif__icon { width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center; flex: none; }
.notif__icon svg { width: 17px; height: 17px; }
.notif__icon--price        { background: var(--fresh-live-bg);   color: var(--fresh-live); }
.notif__icon--availability { background: var(--fresh-recent-bg); color: var(--fresh-recent); }
.notif__icon--freshness    { background: var(--fresh-today-bg);  color: var(--fresh-today); }
.notif__icon--newInventory { background: var(--primary-soft);    color: var(--primary-strong); }
.notif__icon--images       { background: var(--fresh-aging-bg);  color: var(--fresh-aging); }
.notif__icon--cloud        { background: #e6ebf1;               color: #3f5f7c; }
.notif__body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notif__title { font-size: 13.5px; font-weight: 700; }
.notif__mat { color: var(--primary-strong); }
.notif__meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-soft); }
.notif__diff { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 3px; font-size: 12.5px; }
.notif__dlabel { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-mute); }
.notif__from { color: var(--text-mute); text-decoration: line-through; }
.notif__to { color: var(--text); font-weight: 700; }
.notif__diff svg { width: 15px; height: 15px; color: var(--text-mute); }
.notif__delta { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--fresh-live-bg); color: var(--fresh-live); }
.notif__side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.notif__time { font-size: 11.5px; color: var(--text-mute); white-space: nowrap; }
.notif__unread { width: 9px; height: 9px; border-radius: var(--radius-pill); background: var(--primary); flex: none; }

/* ---------- bell dropdown (notifications menu) ---------- */
.notif-pop {
  position: fixed; z-index: 1400; width: 360px; max-width: calc(100vw - 16px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.notif-pop[hidden] { display: none; }
.notif-pop__head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.notif-pop__title { font-size: 14px; font-weight: 800; }
.notif-pop__mark {
  border: 0; background: transparent; color: var(--primary);
  font-size: 12.5px; font-weight: 700; padding: 2px 4px;
}
.notif-pop__mark:hover { text-decoration: underline; }
.notif-pop__list {
  overflow-y: auto; max-height: min(70vh, 440px);
  padding: 8px; display: flex; flex-direction: column; gap: 4px;
}
.notif-pop__empty { padding: 26px 14px; text-align: center; color: var(--text-mute); font-size: 13px; }
/* flatten the card rows into a tight menu list inside the dropdown */
.notif-pop .notif { box-shadow: none; border-color: transparent; padding: 9px 8px; gap: 10px; border-radius: var(--radius-sm); }
.notif-pop .notif:hover { transform: none; box-shadow: none; background: var(--surface-2); border-color: transparent; }
.notif-pop .notif.is-unread { border-color: transparent; }
.notif__arrow { color: var(--text-mute); font-weight: 700; }

.notif-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ---------- toast + deep-link banner ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--surface); font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 900;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.deep-banner {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: min(560px, 92vw);
  background: var(--surface); border: 1px solid var(--primary);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 11px 14px; z-index: 800;
}
.db-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-strong); }
.db-icon svg { width: 18px; height: 18px; }
.db-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13px; }
.db-diff { font-size: 12px; color: var(--text-soft); }
.db-diff s { color: var(--text-mute); }
.db-diff b { color: var(--text); }
.db-diff em { font-style: normal; font-weight: 800; color: var(--fresh-live); }
.db-close { margin-left: 4px; flex: none; width: 28px; height: 28px; border: 0; background: var(--surface-2); border-radius: var(--radius-pill); color: var(--text-soft); font-size: 17px; line-height: 1; }
.db-close:hover { background: var(--border); color: var(--text); }

/* ---------- legal / long-form document pages ---------- */
.doc { max-width: 760px; margin: 0 auto; }
.doc-notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--fresh-aging-bg); color: var(--text);
  border: 1px solid var(--border-strong); border-left: 3px solid var(--warn);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 22px; font-size: 12.5px; line-height: 1.55;
}
.doc-notice svg { width: 18px; height: 18px; flex: none; color: var(--warn); margin-top: 1px; }
.doc-notice b { color: var(--text); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-mute); font-size: 12px; margin-bottom: 24px; }
.doc-meta b { color: var(--text-soft); font-weight: 700; }
.doc-toc {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 28px;
}
.doc-toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-mute); margin: 0 0 8px; }
.doc-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; font-size: 13px; }
.doc-toc li { margin: 3px 0; break-inside: avoid; }
.doc-toc a { color: var(--text-soft); text-decoration: none; }
.doc-toc a:hover { color: var(--primary); text-decoration: underline; }
.doc section { margin-bottom: 22px; scroll-margin-top: 82px; }
.doc h2.sec { font-size: 16px; font-family: var(--font-head); letter-spacing: -.2px; margin: 0 0 8px; }
.doc h3 { font-size: 13.5px; margin: 14px 0 4px; }
.doc p { margin: 0 0 10px; color: var(--text-soft); font-size: 13.5px; line-height: 1.62; }
.doc ul { margin: 0 0 10px; padding-left: 20px; color: var(--text-soft); font-size: 13.5px; line-height: 1.62; }
.doc li { margin: 3px 0; }
.doc a { color: var(--primary); }
.doc .ph { color: var(--primary-strong); font-weight: 600; background: var(--primary-soft); padding: 0 4px; border-radius: 4px; }
.doc-footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-mute); display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- responsive ---------- */
@media (max-width: 620px) {
  .field-row, .field-row--3, .role-picker { grid-template-columns: 1fr; }
  .doc-toc ol { columns: 1; }
  .ar { grid-template-columns: 72px 1fr; }
  .ar-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .ar--watch .ar-side { flex-wrap: wrap; }
  .notif { grid-template-columns: 38px 1fr; }
  .notif__side { grid-column: 2; flex-direction: row; align-items: center; gap: 10px; }
}
