/* Verso member portal — design tokens
   Light theme only, per verso-portal-style-guide.md */

:root {
  /* Semantic surfaces */
  --surface-page: #FAFAF8;
  --surface-sidebar: #FFFFFF;
  --surface-card: #FFFFFF;
  --border-card: #ECECE6;

  /* Surfaces */
  --bg-page: var(--surface-page);
  --bg-surface: var(--surface-card);
  --border: var(--border-card);

  /* Text */
  --text-primary: #232320;
  --text-secondary: #8A8A84;
  --text-success: #3B6D11;

  /* Accent (brand) */
  --action-primary: #993018;
  --action-primary-hover: #7A2814;
  --accent: var(--action-primary);
  --accent-bg: #FBEAE6;

  /* Nav group colours */
  --group-account: #0F6E56;
  --group-benefits: #534AB7;
  --group-support: #854F0B;
  --group-account-soft: #E8F3EF;
  --group-support-soft: #FBEAE6;

  /* Member tabs */
  --member-tab-active-bg: #F7ECE8;
  --member-tab-active-text: #993018;

  /* Controlled background image overlays */
  --login-background-image: none;
  --login-background-repeat: repeat;
  --sidebar-background-image: none;
  --sidebar-background-repeat: repeat;
  --page-background-image: none;
  --page-background-repeat: repeat;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.25rem;
  --space-xl: 1.75rem;

  /* Type */
  --font-sans: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-brand: 16px;
  --fs-title: 18px;
  --fs-breadcrumb: 13px;
  --fs-group-label: 12px;
  --fs-nav-item: 14px;
  --fs-tab: 14px;
  --fs-section-header: 14px;
  --fs-field-label: 12px;
  --fs-field-value: 14px;
}

* {
  box-sizing: border-box;
}

.verso-body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.verso-page {
  width: 100%;
}

.verso-icon {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.verso-icon-lg {
  width: 20px;
  height: 20px;
}

/* Layout shell */
.verso-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
  font-family: var(--font-sans);
  color: var(--text-primary);
}

.verso-sidebar {
  width: 216px;
  flex-shrink: 0;
  background-color: var(--surface-sidebar);
  background-image: var(--sidebar-background-image, none);
  background-repeat: var(--sidebar-background-repeat, repeat);
  border-right: 0.5px solid var(--border);
  padding: var(--space-lg) var(--space-sm);
  display: flex;
  flex-direction: column;
}

.verso-sidebar-nav {
  display: grid;
  gap: var(--space-sm);
  min-height: 0;
}

.verso-mobile-nav-toggle {
  display: none;
}

.verso-main {
  flex: 1;
  min-width: 0;
  padding: var(--space-lg) var(--space-xl);
  background-color: var(--surface-page);
  background-image: var(--page-background-image, none);
  background-repeat: var(--page-background-repeat, repeat);
}

.verso-page-header {
  margin-bottom: var(--space-lg);
}

/* Nav */
.verso-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-brand);
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0 var(--space-xs) var(--space-lg);
}

.company-brand {
  display: flex;
  align-items: center;
}

.company-brand__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
}

.company-brand__logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.company-brand__fallback {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.company-brand__text {
  font-size: var(--fs-brand);
  font-weight: 500;
  color: var(--text-primary);
}

.company-brand--login {
  justify-content: center;
}

.company-brand--login .company-brand__logo-wrap {
  justify-content: center;
  max-width: 200px;
  max-height: 120px;
}

.company-brand--sidebar .company-brand__logo-wrap {
  max-width: 130px;
  max-height: 80px;
}

.verso-nav-group {
  margin-bottom: var(--space-md);
}

.verso-nav-group-label {
  font-size: var(--fs-group-label);
  font-weight: 500;
  padding: 0 var(--space-xs);
  margin-bottom: 6px;
}
.verso-nav-group-label.account   { color: var(--group-account); }
.verso-nav-group-label.benefits  { color: var(--group-benefits); }
.verso-nav-group-label.support   { color: var(--group-support); }

.verso-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-nav-item);
  text-decoration: none;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.verso-nav-item.account   { color: var(--group-account); }
.verso-nav-item.benefits  { color: var(--group-benefits); }
.verso-nav-item.support   { color: var(--group-support); }
.verso-nav-item.muted     { color: var(--text-secondary); }

.verso-nav-item.disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.verso-nav-item.active {
  background: var(--group-support-soft);
  color: var(--group-support);
  font-weight: 500;
}

.verso-nav-item.account.active {
  background: var(--group-account-soft);
  color: var(--group-account);
}

.verso-nav-item.support.active {
  background: var(--group-support-soft);
  color: var(--group-support);
}

.verso-nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.verso-nav-divider {
  border-top: 0.5px solid var(--border);
  margin: 14px 0 8px;
}

/* Header */
.verso-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.verso-breadcrumb {
  font-size: var(--fs-breadcrumb);
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.verso-title {
  font-size: var(--fs-title);
  font-weight: 500;
  margin: 0;
}

.verso-page-title {
  margin: 0 0 var(--space-md);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.verso-user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.verso-user-name {
  font-size: 14px;
  color: var(--text-secondary);
}

.verso-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
}

.verso-feedback-icon {
  font-size: 19px;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  padding: 0;
}

/* Tabs */
.verso-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.verso-tab {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.15rem 10px;
  white-space: nowrap;
  font-size: var(--fs-tab);
  color: var(--text-secondary);
  cursor: pointer;
}

.verso-tab.active {
  font-weight: 500;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.verso-tab-link {
  color: inherit;
  text-decoration: none;
}

.verso-tab-link:focus-visible,
.verso-mobile-nav-toggle:focus-visible,
.verso-link-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.verso-tab.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.verso-member-tabs-card {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.verso-member-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  margin-bottom: 0;
  border-bottom: 0;
  border-radius: 10px;
  background: #F6F5F2;
  overflow-x: visible;
}

.verso-member-tabs .verso-tab {
  min-height: 0;
  padding: 8px 12px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: #F9F8F6;
  color: var(--text-primary);
  font-weight: 400;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.verso-member-tabs .verso-tab-link {
  color: inherit;
  text-decoration: none;
}

.verso-member-tabs .verso-tab-link:hover {
  background: #EEECE8;
  border-color: #E5E1DA;
  color: var(--text-primary);
}

.verso-member-tabs .verso-tab.active {
  font-weight: 500;
  color: var(--member-tab-active-text);
  background: var(--member-tab-active-bg);
  border-bottom: 1px solid #E7D1C8;
  border-color: #E7D1C8;
}

.verso-member-tabs .verso-tab-link:focus-visible,
.verso-member-tabs .verso-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Cards */
.verso-card {
  background: var(--surface-card);
  border: 0.5px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.verso-section-header {
  font-size: var(--fs-section-header);
  font-weight: 500;
  margin-bottom: var(--space-md);
}

/* Field grid */
.verso-field-grid {
  display: grid;
  gap: var(--space-lg) var(--space-md);
}
.verso-field-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.verso-field-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.verso-field-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.verso-member-summary {
  gap: var(--space-sm) var(--space-md);
}

.verso-member-summary-card {
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.verso-field-label {
  font-size: var(--fs-field-label);
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.verso-field-value {
  font-size: var(--fs-field-value);
  color: var(--text-primary);
}

.verso-break-word {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.verso-field-value.success { color: var(--text-success); }
.verso-field-value.muted   { color: var(--text-secondary); }

.verso-form-group {
  margin-bottom: var(--space-md);
}

.verso-form-label {
  display: inline-block;
  margin-bottom: 0.35rem;
  font-size: 13px;
  color: var(--text-primary);
}

.verso-form-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.verso-form-control,
.verso-form-select,
.verso-select {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
}

.verso-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
}

.verso-form-control[readonly] {
  background: var(--bg-page);
}

.verso-inline-form {
  display: inline-flex;
  margin-left: 0.35rem;
}

.verso-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #8f1d1d;
}

.verso-link-button:hover {
  background: #f8ece8;
}

.verso-form-control:focus,
.verso-form-select:focus,
.verso-button:focus-visible,
.verso-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.verso-form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.verso-form-check-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}

.verso-form-check input[type="checkbox"],
.verso-form-check input[type="radio"] {
  margin-top: 0.25rem;
}

.verso-field-error,
.field-validation-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 12px;
  color: #8f1d1d;
}

.verso-validation-summary,
.validation-summary-errors {
  border: 0.5px solid #d7b3ab;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  color: #742111;
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  font-size: 13px;
}

.verso-validation-summary ul,
.validation-summary-errors ul {
  margin: 0;
  padding-left: 1rem;
}

.verso-validation-summary:empty,
.validation-summary-valid {
  display: none;
}

.verso-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.verso-button-primary {
  background: var(--action-primary);
  color: var(--bg-surface);
}

.verso-button-primary:hover {
  background: var(--action-primary-hover);
}

.verso-button-secondary {
  background: var(--bg-surface);
  border-color: var(--border);
  color: var(--text-primary);
}

.verso-button-link,
.verso-link {
  color: var(--accent);
  background: transparent;
  border: 0;
  text-decoration: none;
  padding: 0;
}

.verso-alert {
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  border: 0.5px solid var(--border);
  margin-bottom: var(--space-md);
  font-size: 13px;
}

.verso-alert-success {
  background: #f2f8eb;
  color: #2f5c0c;
  border-color: #d5e4c2;
}

.verso-alert-warning {
  background: #fff7eb;
  color: #7a4a0e;
  border-color: #eed7b7;
}

.verso-alert-error {
  background: var(--accent-bg);
  color: #742111;
  border-color: #d7b3ab;
}

.verso-auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background-color: var(--surface-page);
  background-image: var(--login-background-image, none);
  background-repeat: var(--login-background-repeat, repeat);
}

.verso-auth-card {
  width: min(100%, 460px);
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}

.verso-auth-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 var(--space-xs);
}

.verso-auth-subtitle {
  margin: 0 0 var(--space-lg);
  color: var(--text-secondary);
  font-size: 13px;
}

.verso-auth-links {
  display: grid;
  gap: 0.5rem;
  margin-top: var(--space-md);
}

.disclaimer-auth-card {
  width: min(100%, 860px);
}

.disclaimer-card {
  background: transparent;
  border: 0;
  padding: 0;
  margin-top: var(--space-sm);
}

.disclaimer-content {
  max-height: 60vh;
  overflow: auto;
  line-height: 1.55;
  padding: var(--space-md);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
}

.disclaimer-content h1,
.disclaimer-content h2,
.disclaimer-content h3 {
  margin-top: 0;
}

.disclaimer-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

.verso-captcha {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  padding: 0.25rem;
}

.verso-split-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 var(--space-md);
}

.verso-spacing-top {
  margin-top: var(--space-md);
}

.verso-message-card {
  max-width: 720px;
}

.verso-button-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.verso-table-wrap {
  overflow-x: auto;
}

.verso-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.verso-table th,
.verso-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.55rem;
  border-bottom: 0.5px solid var(--border);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.verso-table th {
  color: var(--text-secondary);
  font-weight: 500;
}

.text-end {
  text-align: right !important;
}

.verso-pager,
.verso-investment-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.verso-investment-pager-link {
  color: var(--accent);
  text-decoration: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.verso-investment-pager-link.disabled {
  color: var(--text-secondary);
}

.verso-investment-pager-status {
  font-size: 13px;
  color: var(--text-secondary);
}

.verso-investment-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.verso-investment-size-form {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.verso-investment-range {
  color: var(--text-secondary);
  font-size: 13px;
}

.verso-investment-group {
  margin-top: var(--space-sm);
}

.verso-investment-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  padding: 0.75rem 1rem;
}

.verso-investment-summary::-webkit-details-marker {
  display: none;
}

.verso-investment-summary:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.verso-investment-summary-title {
  flex: 1;
}

.verso-investment-summary-total {
  white-space: nowrap;
}

.verso-investment-summary-toggle {
  transition: transform 0.15s ease;
}

details[open] > summary .verso-investment-summary-toggle {
  transform: rotate(180deg);
}

.verso-investment-body {
  padding: 0 1rem 1rem;
}

.verso-profile-banner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  align-items: flex-start;
  flex-wrap: wrap;
}

.verso-image-fluid {
  max-width: 100%;
  height: auto;
}

@media (max-width: 992px) {
  .verso-shell {
    display: block;
  }

  .verso-sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 0.5px solid var(--border);
    padding: var(--space-sm) var(--space-md);
  }

  .verso-body.nav-ready .verso-mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-sm);
    min-height: 40px;
    width: fit-content;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
  }

  .verso-body.nav-ready .verso-sidebar-nav {
    display: none;
  }

  .verso-body.nav-ready .verso-sidebar.is-open .verso-sidebar-nav {
    display: grid;
  }

  .verso-nav-group {
    margin-bottom: var(--space-sm);
  }

  .verso-main {
    padding: var(--space-lg);
  }

  .verso-field-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .verso-field-grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .verso-main {
    padding: var(--space-md);
  }

  .verso-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .verso-user-menu {
    width: 100%;
    justify-content: flex-start;
  }

  .verso-pager,
  .verso-investment-pager {
    align-items: flex-start;
    flex-direction: column;
  }

  .verso-auth-shell {
    padding: var(--space-md);
  }

  .verso-auth-card {
    padding: var(--space-lg);
  }

  .verso-field-grid.cols-2,
  .verso-field-grid.cols-3,
  .verso-field-grid.cols-4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
