/* Benvia Phase D3: authentication, invitations, setup, privacy, and safe system states. */
.benvia-system-body {
  min-height: 100vh;
  margin: 0;
  background: #f2eee8;
  color: #354b40;
}

.benvia-system-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.benvia-system-shell__header {
  min-height: 76px;
  border-bottom: 1px solid #ded7cd;
  background: rgba(255, 253, 249, 0.96);
  display: flex;
  align-items: center;
}

.benvia-system-shell__bar,
.benvia-system-shell__footer-row {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.benvia-system-shell__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.benvia-system-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #153f2c;
  text-decoration: none;
}

.benvia-system-brand:hover { color: #153f2c; }

/* Montreal Neon company-first header for the employee sign-in experience. */
.benvia-system-body--employee-signin .benvia-system-shell__header {
  min-height: 88px;
}

.benvia-system-body--employee-signin .benvia-system-shell__bar {
  min-width: 0;
  gap: clamp(12px, 3vw, 24px);
}

.benvia-system-body--employee-signin .benvia-system-brand--montreal-neon {
  min-width: 0;
  max-width: min(190px, 38vw);
  display: inline-grid;
  align-items: start;
  gap: 2px;
  padding-block: 6px;
}

.benvia-system-body--employee-signin .public-company-brand__logo {
  width: clamp(138px, 15vw, 170px);
  max-width: 100%;
  display: block;
}

.benvia-system-body--employee-signin .public-company-brand__logo img {
  width: 100%;
  height: auto;
  display: block;
}

.benvia-system-body--employee-signin .public-company-brand__powered {
  justify-self: end;
  color: #7b857f;
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.benvia-system-body--employee-signin .benvia-system-shell__context {
  flex: 0 0 auto;
}

/* Match the restrained Powered by Benvia footer treatment used on the main public page. */
.benvia-system-body--employee-signin .public-platform-credit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #6f7b74;
  white-space: nowrap;
}

.benvia-system-body--employee-signin .public-platform-credit__mark {
  width: 15px;
  height: 22px;
  flex: 0 0 15px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
}

.benvia-system-body--employee-signin .public-platform-credit__mark img {
  width: 14px;
  height: 21px;
  max-width: 14px;
  max-height: 21px;
  display: block;
  object-fit: contain;
}

.benvia-system-brand__mark {
  width: 28px;
  height: 40px;
  display: grid;
  place-items: center;
  background: transparent;
}

.benvia-system-brand__mark img {
  display: block;
  width: 27px;
  height: 39px;
  object-fit: contain;
}

.benvia-system-brand__copy { display: grid; line-height: 1.15; }
.benvia-system-brand__name { font-size: 0.96rem; font-weight: 760; }
.benvia-system-brand__descriptor { margin-top: 3px; color: #6b786f; font-size: 0.72rem; font-weight: 650; }

.benvia-system-shell__context {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  min-width: 0;
}

.benvia-system-shell__tenant { display: grid; text-align: right; line-height: 1.2; }
.benvia-system-shell__tenant span { color: #89958d; font-size: 0.67rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.benvia-system-shell__tenant strong { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #354b40; font-size: 0.84rem; }
.benvia-system-shell__privacy { color: #5d7166; font-size: 0.82rem; font-weight: 650; text-decoration: none; }
.benvia-system-shell__privacy:hover { color: #1d6a4b; }

.benvia-language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #d8d1c7;
  border-radius: 8px;
  background: #f6f2ec;
}

.benvia-language-switcher__form {
  margin: 0;
}

.benvia-language-switcher__option {
  min-height: 32px;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.68rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #596b61;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 720;
  line-height: 1;
  text-decoration: none;
}

.benvia-language-switcher__option:hover {
  color: #153f2c;
  background: #fffdf9;
}

.benvia-language-switcher__option.is-active {
  border-color: #c9d8cf;
  background: #ffffff;
  color: #153f2c;
  box-shadow: 0 2px 7px rgba(21, 63, 44, 0.08);
}

.benvia-language-switcher__option:focus-visible {
  outline: 3px solid rgba(29, 106, 75, 0.24);
  outline-offset: 2px;
}

.benvia-system-shell__main {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 52px 0 64px;
}

.benvia-system-shell__footer {
  border-top: 1px solid #ded7cd;
  background: #fffdf9;
}

.benvia-system-shell__footer-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #748079;
  font-size: 0.76rem;
}

/* Minimal employee sign-in composition */
.system-login-frame {
  width: min(100%, 480px);
  margin: clamp(28px, 7vh, 88px) auto;
  overflow: hidden;
  border: 1px solid #d9d3ca;
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: 0 18px 48px rgba(21, 63, 44, 0.08);
}

.system-login-panel {
  min-width: 0;
  background: #fffdf9;
}

.system-login-panel__inner {
  width: 100%;
  padding: clamp(30px, 5vw, 42px);
}

.system-login-panel__header {
  margin-bottom: 22px;
}

.system-login-panel__header h1 {
  margin: 0 0 8px;
  color: #153f2c;
  font-size: clamp(1.65rem, 3vw, 2rem);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.system-login-panel__header p {
  max-width: 390px;
  margin: 0;
  color: #68776f;
  font-size: 0.86rem;
  line-height: 1.55;
}

.system-login-workspace {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 12px 13px;
  border: 1px solid #dfd9d0;
  border-radius: 8px;
  background: #f8f5f0;
}

.system-login-workspace.is-warning {
  border-color: #e2c57e;
  background: #fff9ed;
}

.system-login-workspace__icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #cedbd3;
  border-radius: 7px;
  color: #1d6a4b;
  background: #ffffff;
}

.system-login-workspace__icon svg {
  width: 16px;
  height: 16px;
}

.system-login-workspace__copy {
  min-width: 0;
  display: grid;
}

.system-login-workspace__copy > span {
  color: #7d8b83;
  font-size: 0.61rem;
  font-weight: 780;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.system-login-workspace__copy strong {
  margin-top: 2px;
  overflow: hidden;
  color: #29473a;
  font-size: 0.84rem;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-login-workspace__copy small {
  margin-top: 2px;
  color: #6b786f;
  font-size: 0.69rem;
}

.system-login-privacy {
  margin: 18px 0 0;
  color: #7b877f;
  font-size: 0.69rem;
  line-height: 1.5;
  text-align: center;
}

.system-access-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(460px, 1.08fr);
  gap: 48px;
  align-items: start;
}

.system-access-brief { padding: 22px 0 0; }
.system-eyebrow { color: #567568; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.system-title { max-width: 680px; margin: 12px 0 14px; color: #153f2c; font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.04; letter-spacing: -0.045em; font-weight: 760; }
.system-lead { max-width: 650px; margin: 0; color: #66766d; font-size: 1rem; line-height: 1.72; }

.system-trust-list { margin-top: 34px; border-top: 1px solid #ded7cd; }
.system-trust-item { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid #ded7cd; }
.system-trust-item__index { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid #c8beb1; border-radius: 7px; background: #fffdf9; color: #386c55; font-size: 0.72rem; font-weight: 800; }
.system-trust-item h2, .system-trust-item h3 { margin: 0 0 4px; color: #29473a; font-size: 0.92rem; font-weight: 750; }
.system-trust-item p { margin: 0; color: #6b786f; font-size: 0.83rem; line-height: 1.55; }

.system-card {
  border: 1px solid #ded7cd;
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: 0 18px 50px rgba(21, 63, 44, 0.08);
}
.system-card__body { padding: 32px; }
.system-card__header { margin-bottom: 24px; }
.system-card__header h1, .system-card__header h2 { margin: 7px 0 7px; color: #153f2c; font-size: 1.42rem; line-height: 1.22; font-weight: 760; }
.system-card__header p { margin: 0; color: #6b786f; font-size: 0.88rem; line-height: 1.6; }

.system-context {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid #ded7cd;
  border-radius: 9px;
  background: #faf7f1;
}
.system-context.is-warning { border-color: #e7c681; background: #fffaf0; }
.system-context__label { display: block; color: #89958d; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.system-context__value { display: block; margin-top: 4px; color: #29473a; font-size: 0.96rem; font-weight: 750; }
.system-context__note { margin-top: 3px; color: #6b786f; font-size: 0.76rem; }
.system-state-label { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border: 1px solid #c8beb1; border-radius: 6px; background: #fffdf9; color: #596f64; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.system-state-label.is-ready { border-color: #9fc7b2; background: #eff8f4; color: #1d6a4b; }
.system-state-label.is-warning { border-color: #e6c47c; background: #fff8e8; color: #805b17; }
.system-state-label.is-danger { border-color: #e3b6b7; background: #fff3f3; color: #8c3033; }

.system-provider-list { display: grid; gap: 10px; margin-top: 16px; }
.system-provider-form { margin: 0; }
.system-provider-button {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border: 1px solid #cfc8bd;
  border-radius: 10px;
  background: #ffffff;
  color: #29473a;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.system-provider-button:hover:not(:disabled) { border-color: #7f9b8c; background: #fbfaf7; box-shadow: 0 10px 24px rgba(21, 63, 44, 0.09); transform: translateY(-1px); }
.system-provider-button:focus-visible { outline: 3px solid rgba(29, 106, 75, 0.24); outline-offset: 2px; }
.system-provider-button:disabled { cursor: not-allowed; opacity: 0.58; background: #f0ebe3; }
.system-provider-button__mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid #d6d0c7; border-radius: 8px; background: #fffdf9; color: #386c55; font-size: 1rem; font-weight: 850; }
.system-provider-button__mark--google { color: #315f4c; font-family: Arial, sans-serif; }
.system-provider-button__microsoft-grid { width: 15px; height: 15px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; }
.system-provider-button__microsoft-grid span { display: block; background: #1d6a4b; }
.system-provider-button__microsoft-grid span:nth-child(2) { background: #4f856d; }
.system-provider-button__microsoft-grid span:nth-child(3) { background: #6f9b85; }
.system-provider-button__microsoft-grid span:nth-child(4) { background: #2f7457; }
.system-provider-button__copy { min-width: 0; display: grid; }
.system-provider-button__name { color: #29473a; font-size: 0.84rem; font-weight: 740; }
.system-provider-button__status { color: #6f7b74; font-size: 0.64rem; font-weight: 780; text-transform: uppercase; letter-spacing: 0.05em; }
.system-provider-button__arrow { width: 24px; height: 24px; display: grid; place-items: center; color: #1d6a4b; }
.system-provider-button__arrow svg { width: 18px; height: 18px; }

.system-note { margin-top: 18px; padding: 14px 16px; border-left: 3px solid #4a8068; background: #edf4f0; color: #5d7166; font-size: 0.79rem; line-height: 1.58; }
.system-note.is-warning { border-left-color: #b8862e; background: #fff8eb; color: #70551f; }
.system-note.is-danger { border-left-color: #b44a4e; background: #fff3f3; color: #7b3437; }
.system-note.is-success { border-left-color: #2d7856; background: #eff8f4; color: #315f4c; }
.system-note strong { color: inherit; }

.system-form-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid #ded7cd; }
.system-form-section__header { margin-bottom: 17px; }
.system-form-section__header h2 { margin: 0 0 5px; color: #29473a; font-size: 1rem; font-weight: 760; }
.system-form-section__header p { margin: 0; color: #6b786f; font-size: 0.8rem; line-height: 1.5; }
.system-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.system-form-grid .is-full { grid-column: 1 / -1; }
.system-card .form-label { margin-bottom: 6px; color: #354b40; font-size: 0.76rem; font-weight: 720; }
.system-card .form-control { min-height: 44px; border-color: #c8beb1; border-radius: 7px; font-size: 0.88rem; }
.system-card .form-control:focus { border-color: #1d6a4b; box-shadow: 0 0 0 3px rgba(29, 106, 75, 0.13); }
.system-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.system-actions .btn { min-height: 42px; border-radius: 7px; font-weight: 700; }

.system-state-layout { width: min(960px, 100%); margin: 0 auto; }
.system-state-layout--wide { width: min(1080px, 100%); }
.system-state-header { max-width: 760px; margin-bottom: 24px; }
.system-state-header h1 { margin: 9px 0 10px; color: #153f2c; font-size: clamp(1.9rem, 4vw, 2.75rem); line-height: 1.08; letter-spacing: -0.035em; font-weight: 760; }
.system-state-header p { margin: 0; color: #6b786f; line-height: 1.65; }
.system-state-columns { display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); gap: 24px; align-items: start; }
.system-panel { border: 1px solid #ded7cd; border-radius: 10px; background: #fffdf9; }
.system-panel__body { padding: 24px; }
.system-panel__header { margin-bottom: 18px; }
.system-panel__header h2 { margin: 5px 0 6px; color: #153f2c; font-size: 1.08rem; font-weight: 760; }
.system-panel__header p { margin: 0; color: #6b786f; font-size: 0.82rem; line-height: 1.55; }

.system-step-list { margin: 0; padding: 0; list-style: none; counter-reset: system-step; }
.system-step-list li { position: relative; min-height: 42px; padding: 0 0 18px 44px; color: #5d7166; font-size: 0.82rem; line-height: 1.55; }
.system-step-list li::before { counter-increment: system-step; content: counter(system-step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #c8beb1; border-radius: 6px; background: #faf7f1; color: #386c55; font-size: 0.7rem; font-weight: 800; }

.system-invite-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid #ded7cd; border-radius: 9px; overflow: hidden; }
.system-invite-field { min-height: 82px; padding: 15px 17px; border-right: 1px solid #e9e3da; border-bottom: 1px solid #e9e3da; background: #fffdf9; }
.system-invite-field:nth-child(2n) { border-right: 0; }
.system-invite-field:nth-last-child(-n+2) { border-bottom: 0; }
.system-invite-field span { display: block; color: #89958d; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.system-invite-field strong { display: block; margin-top: 7px; color: #354b40; font-size: 0.88rem; line-height: 1.35; overflow-wrap: anywhere; }

.system-requirement-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.system-requirement { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; padding: 13px 14px; border: 1px solid #ded7cd; border-radius: 8px; background: #faf7f1; }
.system-requirement__mark { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid #c8beb1; border-radius: 6px; color: #6b786f; font-size: 0.72rem; font-weight: 850; }
.system-requirement.is-complete .system-requirement__mark { border-color: #9bc7b4; background: #eaf6f0; color: #1c684b; }
.system-requirement h3 { margin: 1px 0 3px; color: #354b40; font-size: 0.84rem; font-weight: 750; }
.system-requirement p { margin: 0; color: #6b786f; font-size: 0.76rem; line-height: 1.45; }

.system-info-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.system-info-card { padding: 20px; border: 1px solid #ded7cd; border-radius: 9px; background: #fffdf9; }
.system-info-card h2 { margin: 0 0 8px; color: #354b40; font-size: 0.92rem; font-weight: 760; }
.system-info-card p { margin: 0; color: #6b786f; font-size: 0.8rem; line-height: 1.58; }
.system-reference { padding: 16px; border: 1px dashed #b9aea0; border-radius: 8px; background: #faf7f1; }
.system-reference code { display: block; margin-top: 6px; color: #3b5f4f; overflow-wrap: anywhere; }
.system-reference p { margin: 7px 0 0; color: #6b786f; font-size: 0.76rem; }

@media (max-width: 991.98px) {
  .system-login-frame { margin-block: 24px; }
  .system-access-grid, .system-state-columns { grid-template-columns: 1fr; gap: 28px; }
  .system-access-brief { padding-top: 0; }
  .system-title { max-width: 760px; }
}

@media (max-width: 767.98px) {
  .benvia-system-shell__bar, .benvia-system-shell__footer-row, .benvia-system-shell__main { width: min(100% - 28px, 1240px); }
  .benvia-system-body--employee-signin .benvia-system-shell__header { min-height: 78px; }
  .benvia-system-body--employee-signin .benvia-system-brand--montreal-neon { max-width: min(158px, 46vw); padding-block: 5px; }
  .benvia-system-body--employee-signin .public-company-brand__logo { width: clamp(122px, 38vw, 148px); }
  .benvia-system-body--employee-signin .public-company-brand__powered { font-size: 0.54rem; }
  .benvia-system-body--employee-signin .public-platform-credit { gap: 5px; }
  .benvia-system-shell__main { padding: 32px 0 44px; }
  .benvia-system-shell__tenant { display: none; }
  .benvia-system-shell__context { gap: 10px; }
  .benvia-system-shell__privacy { display: none; }
  .system-login-panel__inner { padding: 34px 26px; }
  .system-card__body, .system-panel__body { padding: 21px; }
  .system-form-grid, .system-invite-summary, .system-info-grid { grid-template-columns: 1fr; }
  .system-invite-field { border-right: 0; }
  .system-invite-field:nth-last-child(-n+2) { border-bottom: 1px solid #e9e3da; }
  .system-invite-field:last-child { border-bottom: 0; }
  .system-actions { justify-content: stretch; }
  .system-actions .btn { flex: 1 1 100%; }
  .system-state-label { white-space: normal; text-align: center; }
  .system-provider-button { grid-template-columns: 38px minmax(0, 1fr) auto; }
}

@media (max-width: 479.98px) {
  .benvia-system-brand__descriptor { display: none; }
  .benvia-system-body--employee-signin .benvia-system-shell__bar { width: min(100% - 20px, 1240px); gap: 8px; }
  .benvia-system-body--employee-signin .benvia-system-brand--montreal-neon { max-width: 138px; }
  .benvia-system-body--employee-signin .public-company-brand__logo { width: 128px; }
  .benvia-system-body--employee-signin .public-company-brand__powered { font-size: 0.51rem; letter-spacing: 0.025em; }
  .benvia-language-switcher__option { min-width: 38px; padding-inline: 0.48rem; font-size: 0.68rem; }
  .system-login-frame { border-radius: 13px; }
  .system-title { font-size: 2rem; }
  .system-requirement { grid-template-columns: 26px 1fr; }
  .system-requirement .system-state-label { grid-column: 2; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .system-provider-button, .benvia-language-switcher__option { transition: none; }
}
