/* ARC Client Portal — RSC brand palette (#122878 blue / #f1f1f1 grey / #6e6e6e grey). Light only. */
:root {
  color-scheme: light;
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --surface-strong: #ececec;
  --border: #e2e2e2;
  --border-strong: #cccccc;
  --text: #3a3f45;
  --ink: #122878;
  --muted: #6e6e6e;
  --muted-2: #9a9a9a;
  --navy: #122878;
  --navy-700: #0d1c54;
  --navy-300: #3d4a8f;
  --steel: #122878;
  --steel-300: #9aa6d8;
  --green: #4a9d5a;
  --green-700: #3d8449;
  --danger: #c0563f;
  --warn: #d99a2b;
  --primary: #122878;
  --accent: #122878;
  --accent-soft: #e7eaf6;
  --success: #4a9d5a;
  --shadow: 0 1px 3px rgba(18, 40, 120, 0.1), 0 1px 2px rgba(18, 40, 120, 0.05);
  --shadow-soft: 0 1px 3px rgba(18, 40, 120, 0.1), 0 1px 2px rgba(18, 40, 120, 0.05);
  --overlay: rgba(13, 28, 84, 0.55);
  --table-hover: #f3f4f9;
  --table-active: #e7eaf6;
  --viewer-bg: #ececec;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body.portal-body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.portal-shell {
  max-width: 1520px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

/* Login page: deep-navy Ephoro backdrop with a floating white card */
body.login-body {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #122878 0%, #0d1c54 100%);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.panel,
.summary-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.section-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--steel);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--ink);
}

.section-heading p {
  margin: 0;
  max-width: 480px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 15px;
}

/* Topbar — navy Ephoro bar with white content */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  background: var(--navy);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  box-shadow: var(--shadow);
}

.brand-wrap {
  display: flex;
  gap: 16px;
  align-items: center;
}

.brand-wrap-horizontal {
  align-items: center;
}

.brand-logo {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-logo img {
  height: 100%;
  width: auto;
  object-fit: contain;
}

.brand-text {
  min-width: 0;
  max-width: 600px;
}

.brand-text h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;
}

.brand-text .section-kicker {
  color: var(--steel-300);
}

.brand-text p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.6;
  max-width: 58ch;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.topbar-actions-auth {
  gap: 10px;
  flex-wrap: wrap;
}

.user-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.user-pill {
  gap: 8px;
}

.user-pill-label {
  color: var(--muted);
}

.user-pill-value {
  font-weight: 700;
}

/* Topbar-scoped versions sit on navy, so invert them */
.topbar .user-pill {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.topbar .user-pill-label {
  color: rgba(255, 255, 255, 0.65);
}

.topbar .secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  box-shadow: none;
}

.topbar .secondary-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.top-filters-panel {
  padding: 22px 24px 20px;
  margin-bottom: 24px;
}

.top-filters-grid {
  display: grid;
  gap: 16px;
  align-items: end;
}

.top-filters-grid-portal {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.filter-field {
  min-width: 0;
}

.filter-field-search-wide {
  grid-column: span 2;
}

.filter-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.filter-field input,
.filter-field select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.filter-field input::placeholder {
  color: var(--muted-2);
}

.filter-field input:focus,
.filter-field select:focus {
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(89, 146, 182, 0.2);
  background: var(--surface);
}

.date-input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.75;
  cursor: pointer;
}

.filter-presets {
  grid-column: span 3;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.preset-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.preset-btn:hover {
  border-color: var(--steel);
  background: var(--accent-soft);
  color: var(--navy);
}

.filter-actions-top {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: end;
  grid-column: span 2;
}

.filter-help {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.top-filter-help {
  margin: 16px 0 0;
}

.summary-panel {
  padding: 20px;
  margin-bottom: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  min-height: 118px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid #dbe6ee;
  color: var(--steel);
}

.stat-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.3;
}

.stat-value {
  color: var(--ink);
  font-weight: 700;
  font-size: 30px;
  line-height: 1.1;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
}

.stat-value-small {
  font-size: 18px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(520px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.workspace-grid.viewer-hidden {
  grid-template-columns: 1fr;
}

.register-panel,
.viewer-panel {
  padding: 22px;
  min-height: 760px;
}

.viewer-panel-hidden {
  display: none;
}

.register-head,
.viewer-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.register-head h3,
.viewer-panel-header h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.register-head p,
.viewer-panel-header p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.table-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  background: var(--surface-soft);
}

.status-message {
  min-height: 22px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  width: 100%;
}

.table-wrap-vertical-only {
  max-height: 980px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.doc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.doc-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.doc-table th,
.doc-table td {
  text-align: left;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
  line-height: 1.45;
}

.doc-table tbody tr {
  transition: background 0.16s ease;
}

.doc-table tbody tr:hover {
  background: var(--table-hover);
}

.doc-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.sort-btn:hover {
  color: var(--ink);
}

.sort-btn.active {
  color: var(--ink);
}

.sort-indicator::before {
  content: "↕";
  font-size: 13px;
  letter-spacing: 0;
  color: var(--muted-2);
}

.sort-btn.active[data-direction="asc"] .sort-indicator::before {
  content: "↑";
  color: var(--steel);
}

.sort-btn.active[data-direction="desc"] .sort-indicator::before {
  content: "↓";
  color: var(--steel);
}

.col-site {
  width: 12%;
}

.col-function {
  width: 18%;
}

.col-reference {
  width: 16%;
}

.col-client-ref {
  width: 18%;
}

.col-date {
  width: 14%;
}

.col-files {
  width: 14%;
}

.cell-function,
.cell-client-ref {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cell-reference,
.cell-date {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-heading,
.action-cell {
  text-align: right;
}

.download-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: stretch;
}

.download-actions-row {
  flex-direction: row;
  flex-wrap: wrap;
}

.primary-btn,
.secondary-btn,
.open-doc-btn,
.secondary-doc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  text-decoration: none;
}

.primary-btn,
.open-doc-btn {
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--navy);
  box-shadow: var(--shadow);
}

.secondary-btn,
.secondary-doc-btn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.primary-btn:hover,
.open-doc-btn:hover {
  background: var(--navy-700);
  border-color: var(--navy-700);
}

.secondary-btn:hover,
.secondary-doc-btn:hover {
  border-color: var(--steel);
  color: var(--navy);
}

.primary-btn:disabled,
.secondary-btn:disabled,
.open-doc-btn:disabled,
.secondary-doc-btn:disabled,
.login-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-btn:disabled,
.login-btn:disabled {
  background: #9fb0b8;
  border-color: #9fb0b8;
  color: #f4f7f8;
}

.secondary-btn:disabled,
.open-doc-btn:disabled,
.secondary-doc-btn:disabled {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  color: var(--muted);
}

.icon-btn {
  padding-left: 14px;
  padding-right: 14px;
}

.open-doc-btn,
.secondary-doc-btn {
  min-height: 42px;
  min-width: 122px;
  white-space: nowrap;
}

.btn-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.compact-action-btn {
  min-width: 0;
  white-space: nowrap;
  padding: 9px 12px;
  font-size: 12px;
}

.empty-state {
  padding: 36px 0;
  color: var(--muted);
  text-align: center;
}

.active-row {
  background: var(--table-active);
}

.file-missing {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
}

.viewer-reference-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.viewer-reference-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.viewer-reference-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.viewer-frame-wrap {
  position: relative;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: var(--viewer-bg);
  border: 1px solid var(--border);
}

.viewer-frame-wrap-large {
  min-height: 920px;
  height: 920px;
}

#pdfViewerFrame {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

.viewer-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--surface-soft);
}

.viewer-placeholder.hidden {
  display: none;
}

.viewer-placeholder-inner {
  max-width: 320px;
  text-align: center;
}

.viewer-placeholder-inner h4 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.viewer-placeholder-inner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.session-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--overlay);
  backdrop-filter: blur(4px);
}

.session-overlay.hidden {
  display: none;
}

.session-card {
  width: 100%;
  max-width: 460px;
  padding: 30px;
  text-align: center;
}

.session-card h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.session-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.session-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  max-width: 520px;
  padding: 40px 44px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(13, 28, 84, 0.4);
}

/* Standalone RSC logo — no container box, no accompanying text, ~25% larger */
.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.login-logo {
  height: 70px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.login-brand-text {
  text-align: center;
}

.login-brand-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.login-brand-text p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.login-copy {
  text-align: center;
  margin-bottom: 4px;
}

.login-copy h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
}

.login-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.login-form {
  margin-top: 18px;
}

.login-actions {
  margin-top: 22px;
}

.login-btn {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  border-radius: var(--radius-sm);
}

.login-footnote {
  margin-top: 16px;
  color: var(--muted-2);
  font-size: 13px;
  min-height: 18px;
  text-align: center;
}

/* Dark-mode toggle removed — Ephoro is light only. */
.theme-toggle {
  display: none !important;
}

.hidden {
  display: none !important;
}

@media (max-width: 1440px) {
  .top-filters-grid-portal {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .filter-field-search-wide {
    grid-column: span 2;
  }

  .filter-presets {
    grid-column: span 2;
  }

  .filter-actions-top {
    grid-column: span 2;
  }

  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .table-wrap-vertical-only {
    max-height: 720px;
  }

  .viewer-frame-wrap-large {
    min-height: 760px;
    height: 760px;
  }
}

@media (max-width: 980px) {
  .portal-shell {
    padding: 18px;
  }

  .topbar,
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .top-filters-grid-portal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-field-search-wide,
  .filter-presets,
  .filter-actions-top {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .brand-wrap-horizontal {
    flex-direction: row;
    align-items: center;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-filters-grid-portal {
    grid-template-columns: 1fr;
  }

  .filter-field-search-wide,
  .filter-presets,
  .filter-actions-top {
    grid-column: span 1;
  }

  .filter-actions-top {
    flex-direction: column;
    width: 100%;
  }

  .register-panel,
  .viewer-panel {
    min-height: auto;
    padding: 18px;
  }

  .table-wrap-vertical-only {
    max-height: none;
  }

  .doc-table th,
  .doc-table td {
    padding: 12px 10px;
    font-size: 12px;
  }

  .download-actions-row {
    flex-direction: column;
  }

  .viewer-frame-wrap-large {
    min-height: 520px;
    height: 520px;
  }

  .login-card {
    padding: 24px 20px;
  }
}

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

  .open-doc-btn,
  .secondary-doc-btn,
  .primary-btn,
  .secondary-btn,
  .login-btn {
    width: 100%;
  }
}

/* Remove empty helper copy blocks after the hint text was deleted. */
.filters-copy p:empty,
.filter-note:empty,
.table-meta-chip:empty,
.filter-copy h2:empty,
.login-brand-text p:empty,
.login-copy p:empty,
.brand-text p:empty,
.top-filter-help:empty {
  display: none;
}

/* ---- Analytics (Clients per Region / Records per Month) ---- */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  padding: 22px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.chart-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.chart-year {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-year label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.chart-year select {
  width: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.chart-year select:focus {
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(18, 40, 120, 0.18);
}

.chart-body svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-empty {
  padding: 56px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.chart-label {
  font-size: 12px;
  fill: var(--muted);
  font-weight: 600;
}

.chart-value {
  font-size: 12px;
  fill: var(--ink);
  font-weight: 700;
}

.chart-bar {
  fill: var(--navy);
  transition: fill 0.15s ease;
}

.bar-row:hover .chart-bar {
  fill: var(--navy-700);
}

.chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-axis {
  font-size: 10px;
  fill: var(--muted-2);
}

.chart-line {
  fill: none;
  stroke: var(--navy);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart-area {
  fill: rgba(18, 40, 120, 0.08);
  stroke: none;
}

.chart-dot {
  fill: #fff;
  stroke: var(--navy);
  stroke-width: 2;
}

.chart-dot:hover {
  fill: var(--navy);
}

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

/* ---- Legal links: dashboard footer + login ---- */
.legal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding: 16px 4px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.legal-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.legal-links a {
  color: var(--navy);
  font-weight: 600;
}

.legal-links a:hover {
  text-decoration: underline;
}

.login-legal {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}

.login-legal a {
  color: var(--navy);
  font-weight: 600;
}

.login-legal a:hover {
  text-decoration: underline;
}

.login-legal .sep {
  color: var(--muted-2);
}

/* ---- Legal document pages ---- */
.legal-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.legal-back {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
}

.legal-page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 36px 40px;
}

.legal-logo {
  height: 52px;
  width: auto;
  margin-bottom: 18px;
}

.legal-page h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

.legal-page h2 {
  margin: 26px 0 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.legal-page p,
.legal-page li {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}

.legal-page ul {
  margin: 0 0 10px;
  padding-left: 22px;
}

.legal-page a {
  color: var(--navy);
  font-weight: 600;
}

.legal-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 20px;
}

@media (max-width: 640px) {
  .legal-page {
    padding: 24px 20px;
  }

  .legal-footer {
    justify-content: center;
    text-align: center;
  }
}

/* ---- Show/hide password toggle ---- */
.pw-wrap {
  position: relative;
}

.pw-wrap input {
  padding-right: 64px;
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  font-family: inherit;
}

.pw-toggle:hover {
  text-decoration: underline;
}
