/* ============================================================================
   Mtrix Trust Center — styles
   Light theme, SafeBase-style Trust Center layout, Mtrix tokens (spec §2).
   ========================================================================== */

/* --------------------------------------------------------------- tokens */
:root {
  --bg:            #F7F8FA;
  --card:          #FFFFFF;
  --border:        #E6E7EB;
  --border-strong: #D9D9DE;
  --ink:           #0C0C0C;
  --ink-2:         #4B4B52;
  --ink-3:         #8A8A93;
  --green:         #26AB74;
  --link:          #0C0C0C;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 2px rgba(16,17,26,.04), 0 1px 3px rgba(16,17,26,.06);
  --shadow-lg:     0 10px 30px rgba(16,17,26,.10), 0 4px 12px rgba(16,17,26,.06);
  --maxw:          1180px;
  --font:          Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink-2);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; margin: 0; line-height: 1.3; }
p { margin: 0; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { opacity: .72; }
button { font-family: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* --------------------------------------------------------------- layout */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; }
.section { margin-bottom: 20px; }

/* --------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  height: 56px; display: flex; align-items: center; gap: 12px;
}
.brand-mark { height: 26px; width: auto; display: block; }
.brand-word { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.header-divider { width: 1px; height: 18px; background: var(--border-strong); margin: 0 2px; }
.header-title { font-size: 15px; font-weight: 400; color: var(--ink-2); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  border-radius: var(--radius-sm); padding: 8px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, opacity .15s ease;
}
.btn:hover { background: #26262b; border-color: #26262b; }
.btn svg { width: 14px; height: 14px; }
.btn-secondary {
  background: var(--card); color: var(--ink); border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: #f2f3f5; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card); color: var(--ink-2);
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: #f2f3f5; color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.ghost:hover { background: #f2f3f5; }
.icon-btn.active { background: #f0f1f3; color: var(--ink); border-color: var(--border-strong); }

/* --------------------------------------------------------------- card */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.card-head-left h3 { font-size: 15px; }
.card-head-left .head-icon { color: var(--ink); flex: none; }
.card-head-left .head-icon svg { width: 18px; height: 18px; }
.card-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* --------------------------------------------------------------- review banner */
.review-banner {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; padding-top: 25px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.review-banner::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--ink);
}
.review-banner h2 { font-size: 17px; }

/* --------------------------------------------------------------- search bar */
.search-bar {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 11px 14px; display: flex; align-items: center; gap: 10px;
}
.search-bar .search-ic { color: var(--ink-3); flex: none; }
.search-bar .search-ic svg { width: 18px; height: 18px; }
.search-bar input {
  flex: 1 1 auto; min-width: 0; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15px; color: var(--ink);
}
.search-bar input::placeholder { color: var(--ink-3); }
.search-bar .search-tools { display: flex; align-items: center; gap: 8px; flex: none; }

/* --------------------------------------------------------------- two column */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.overview-body p { color: var(--ink-2); font-size: 14.5px; margin-bottom: 12px; }
.overview-body p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------- compliance */
.compliance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 12px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 9px; }
.badge-tile {
  position: relative; width: 60px; height: 60px;
  border: none; background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.badge-img {
  width: 56px; height: 56px; object-fit: contain; display: block;
}
.badge-check {
  position: absolute; left: -2px; bottom: -2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--green);
  border: 2px solid var(--card); display: flex; align-items: center; justify-content: center; color: #fff;
}
.badge-check svg { width: 9px; height: 9px; }
.badge-label { font-size: 12px; color: var(--ink-2); line-height: 1.3; }

/* --------------------------------------------------------------- trusted by */
.trusted { text-align: center; }
.trusted-caption {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin-bottom: 16px;
}
.trusted-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 32px; }
.brand-word-mono {
  font-size: 17px; font-weight: 700; color: #a2a2ab; letter-spacing: -.01em;
  filter: grayscale(1); opacity: .9;
}

/* --------------------------------------------------------------- documents */
.tabs { display: flex; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.tab {
  padding: 6px 12px; border-radius: var(--radius-sm); border: none; background: transparent;
  font-size: 13px; font-weight: 500; color: var(--ink-3); cursor: pointer; transition: background .15s, color .15s;
}
.tab:hover { color: var(--ink); background: #f2f3f5; }
.tab.active { color: var(--ink); background: #f0f1f3; font-weight: 600; }

.doc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.doc-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 0; width: 100%;
  border: none; border-bottom: 1px solid var(--border); background: transparent;
  text-align: left; font-family: inherit; cursor: pointer; color: inherit;
  transition: opacity .15s ease;
}
.doc-row:hover { opacity: .7; }
.doc-ic {
  flex: none; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: #fafafb; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.doc-ic svg { width: 16px; height: 16px; }
.doc-text { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.doc-cat { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.doc-title { font-size: 14px; color: var(--ink); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-action { flex: none; display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.doc-action svg { width: 15px; height: 15px; }
.doc-footer { margin-top: 14px; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 500;
  color: var(--ink); text-decoration: none;
}
.link-arrow:hover { opacity: .7; }
.link-arrow svg { width: 14px; height: 14px; }

/* --------------------------------------------------------------- category grid */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cat-grid.list-view { grid-template-columns: 1fr; }
.cat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 14px; cursor: pointer;
  display: flex; flex-direction: column;
  transition: box-shadow .15s ease, border-color .15s ease, transform .12s ease;
}
.cat-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.cat-card.hidden { display: none; }
.cat-card-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.cat-card-head .head-icon { color: var(--ink); flex: none; }
.cat-card-head .head-icon svg { width: 18px; height: 18px; }
.cat-card-head h3 { font-size: 14.5px; }
.cat-items { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; }
.cat-item {
  display: flex; align-items: center; gap: 9px; padding: 5px 0; font-size: 13.5px; color: var(--ink-2);
}
.cat-item .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item .val { margin-left: auto; font-weight: 600; color: var(--ink); flex: none; }
.cat-footer { margin-top: 12px; }

/* status check */
.check {
  flex: none; width: 17px; height: 17px; border-radius: 50%; background: var(--green);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.check svg { width: 9px; height: 9px; }

/* --------------------------------------------------------------- subprocessors */
.sub-search-wrap {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; background: var(--card);
}
.sub-search-wrap .search-ic { color: var(--ink-3); flex: none; }
.sub-search-wrap .search-ic svg { width: 16px; height: 16px; }
.sub-search-wrap input {
  flex: 1 1 auto; min-width: 0; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 14px; color: var(--ink);
}
.sub-search-wrap input::placeholder { color: var(--ink-3); }

.sub-table { display: flex; flex-direction: column; }
.sub-head, .sub-row {
  display: grid; grid-template-columns: 1.5fr 2.2fr 1fr; gap: 16px; align-items: center;
}
.sub-head {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); padding: 8px 0; border-bottom: 1px solid var(--border);
}
.sub-row { padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.sub-row.hidden { display: none; }
.sub-company { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sub-logo {
  flex: none; width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border);
  background: #ffffff; color: var(--ink); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sub-logo-img {
  width: 20px; height: 20px; object-fit: contain; display: block;
}
.sub-company .nm { color: var(--ink); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-purpose, .sub-loc { color: var(--ink-2); }
.sub-empty { padding: 20px 0; color: var(--ink-3); font-size: 14px; text-align: center; }

/* --------------------------------------------------------------- updates */
.update { padding: 20px 0; border-bottom: 1px solid var(--border); }
.update:first-of-type { padding-top: 4px; }
.update-date { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 9999px; margin-bottom: 9px;
  border: 1px solid var(--border-strong); background: #fafafb; color: var(--ink-2);
}
.tag[data-tag="Security"]      { color: #1f6feb; border-color: #cfe0fb; background: #f0f6ff; }
.tag[data-tag="Compliance"]    { color: #1a7f52; border-color: #bfe6d3; background: #eef9f3; }
.tag[data-tag="Subprocessors"] { color: #7a4bd0; border-color: #ddd0f4; background: #f6f1fe; }
.tag[data-tag="Vulnerability"] { color: #b4451f; border-color: #f4d3c5; background: #fef2ec; }
.update-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.update-body { font-size: 14px; color: var(--ink-2); }
.update-body a { font-weight: 500; }

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card); color: var(--ink-2);
  font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover:not(:disabled) { background: #f2f3f5; color: var(--ink); }
.page-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.page-btn:disabled { opacity: .4; cursor: default; }
.page-btn svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------- footer */
.site-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 24px 0 8px; margin-top: 20px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-3);
}
.footer-links { display: flex; align-items: center; gap: 18px; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* --------------------------------------------------------------- floating rail */
.rail {
  position: fixed; left: 24px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 40;
}
.rail button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.rail button:hover { background: #f2f3f5; color: var(--ink); }
.rail button svg { width: 18px; height: 18px; }

/* --------------------------------------------------------------- drawer */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(12,12,14,.45);
  opacity: 0; pointer-events: none; transition: opacity .24s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; z-index: 101;
  width: min(520px, 92vw); background: var(--card);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .24s ease;
  box-shadow: -12px 0 40px rgba(16,17,26,.16);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--border); flex: none;
}
.drawer-head .head-icon { color: var(--ink); flex: none; }
.drawer-head .head-icon svg { width: 20px; height: 20px; }
.drawer-head h2 { font-size: 17px; flex: 1 1 auto; min-width: 0; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 20px 24px; }

.drawer-row { display: flex; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.drawer-row:last-child { border-bottom: none; }
.drawer-row .row-lead { flex: none; padding-top: 1px; }
.drawer-row .row-body { min-width: 0; flex: 1 1 auto; }
.drawer-row .row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.drawer-row .row-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.drawer-row .row-val { font-size: 14px; font-weight: 600; color: var(--ink); flex: none; }
.drawer-row .row-desc { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }

.drawer-section-body { padding: 12px 0 4px; }
.drawer-section-body p { font-size: 14.5px; color: var(--ink-2); margin-bottom: 12px; }
.drawer-section-body p:last-child { margin-bottom: 0; }
.drawer-compliance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 12px; padding: 12px 0; }

/* drawer forms (Get access / Subscribe) */
.drawer-form { padding: 16px 0; display: flex; flex-direction: column; gap: 14px; }
.drawer-form .intro { font-size: 14px; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.field input {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: inherit; font-size: 14px; color: var(--ink); background: var(--card); outline: none;
}
.field input:focus { border-color: var(--ink); }
.drawer-form .btn { justify-content: center; padding: 10px 14px; }
.form-success {
  display: none; align-items: center; gap: 8px; margin-top: 4px;
  font-size: 13.5px; color: var(--green); font-weight: 500;
}
.form-success.show { display: flex; }
.form-success svg { width: 16px; height: 16px; }

/* --------------------------------------------------------------- scroll lock */
html.drawer-open, body.drawer-open { overflow: hidden; }

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .rail { display: none; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .compliance-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
  .review-banner { flex-direction: column; align-items: flex-start; }
  .doc-list { grid-template-columns: 1fr; }
  .sub-head { display: none; }
  .sub-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 0; }
  .sub-purpose::before { content: "Purpose: "; color: var(--ink-3); }
  .sub-loc::before { content: "Location: "; color: var(--ink-3); }
}
@media (max-width: 680px) {
  .cat-grid { grid-template-columns: 1fr; }
  .compliance-grid { grid-template-columns: repeat(3, 1fr); }
  .drawer-compliance { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 375px) {
  .wrap { padding: 0 16px; }
  .card { padding: 18px; }
  .compliance-grid { grid-template-columns: repeat(2, 1fr); }
}
