@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap');

/* Safi Nyumbani auth — a calm mint canvas, compact forms, and unmistakable green. */
body.auth-branded {
  --primary: #078966;
  --primary-dark: #08684f;
  --primary-light: #20a980;
  --steel: #08684f;
  --bg: #f2faf6;
  --bg-soft: #e6f5ed;
  --bg-card: #ffffff;
  --bg-card-glass: #ffffff;
  --bg-input-glass: #fbfefc;
  --text: #18342b;
  --muted: #65796f;
  --border: rgba(16, 99, 72, .14);
  --border-strong: rgba(16, 99, 72, .25);
  --shadow-card: 0 18px 48px rgba(18, 77, 56, .09);
  --radius-control: 11px;
  --radius-panel: 22px;
  min-height: 100dvh;
  color: var(--text);
  color-scheme: light;
  background:
    radial-gradient(ellipse at 8% 6%, rgba(216, 244, 228, .82), transparent 31%),
    radial-gradient(ellipse at 94% 93%, rgba(203, 239, 220, .68), transparent 34%),
    #f3faf6;
  font-family: 'DM Sans', sans-serif;
}

body.auth-branded *,
body.auth-branded *::before,
body.auth-branded *::after {
  box-sizing: border-box;
}

body.auth-branded .app-container {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(390px, 1.1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 0 58px;
  width: min(100% - 56px, 1060px);
  max-width: 1060px;
  min-height: min(760px, calc(100dvh - 56px));
  margin: 28px auto;
  padding: 0;
}

body.auth-branded .top-row {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 48px;
  margin: 2px 0 16px;
  padding: 0 2px 12px;
  border-bottom: 1px solid rgba(8, 104, 79, .12) !important;
}

body.auth-branded .brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--primary-dark);
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.035em;
  text-decoration: none;
}

body.auth-branded .brand-mark-small {
  width: 30px;
  height: 30px;
}

body.auth-branded .lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(8, 104, 79, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
}

body.auth-branded .lang-btn {
  min-width: 35px;
  min-height: 29px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #687a72;
  font: 800 10px 'DM Sans', sans-serif;
  cursor: pointer;
}

body.auth-branded .lang-btn.active,
body.auth-branded .lang-btn[aria-pressed="true"] {
  background: #e6f5ed;
  color: #08684f;
}

body.auth-branded .auth-brand-panel {
  position: relative;
  isolation: isolate;
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  min-height: 630px;
  overflow: hidden;
  padding: clamp(32px, 4vw, 48px);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 25px;
  background:
    radial-gradient(circle at 88% 86%, rgba(88, 195, 145, .23), transparent 30%),
    linear-gradient(152deg, #087b5d 0%, #06644e 100%);
  color: #fff;
  box-shadow: 0 22px 55px rgba(15, 81, 59, .12);
}

body.auth-branded .auth-brand-panel::before,
body.auth-branded .auth-brand-panel::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(221, 248, 232, .17);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

body.auth-branded .auth-brand-panel::before {
  right: -190px;
  bottom: -110px;
  width: 440px;
  height: 440px;
  box-shadow: 0 0 0 28px rgba(221, 248, 232, .045), 0 0 0 65px rgba(221, 248, 232, .035);
}

body.auth-branded .auth-brand-panel::after {
  top: 43%;
  left: -160px;
  width: 230px;
  height: 230px;
  border-color: rgba(221, 248, 232, .11);
}

body.auth-branded .auth-brand-panel .brand-logo {
  align-self: flex-start;
  gap: 10px;
  color: #fff;
  font-size: 17px;
}

body.auth-branded .auth-brand-panel .brand-mark-small {
  width: 36px;
  height: 36px;
  filter: brightness(0) invert(1);
}

body.auth-branded .auth-brand-copy {
  position: relative;
  z-index: 1;
  max-width: 370px;
  margin: 40px 0;
}

body.auth-branded .auth-brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  color: #bfead4;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: none;
}

body.auth-branded .auth-brand-eyebrow::before {
  width: 22px;
  height: 2px;
  background: #9bdfba;
  content: "";
}

body.auth-branded .auth-brand-copy h2 {
  margin: 0 0 16px;
  color: #fff;
  font: 800 clamp(34px, 4vw, 49px)/1.06 'Manrope', sans-serif;
  letter-spacing: -.055em;
}

body.auth-branded .auth-brand-copy p {
  max-width: 325px;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 14px;
  line-height: 1.75;
}

body.auth-branded .auth-brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255, 255, 255, .83);
  font-size: 11px;
  font-weight: 600;
}

body.auth-branded .auth-brand-foot::before {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #a7e4bf;
  box-shadow: 0 0 0 5px rgba(167, 228, 191, .12);
  content: "";
}

body.auth-branded .auth-card,
body.auth-branded .app-container > main.app-box {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: none;
  padding: clamp(28px, 4vw, 42px);
  border: 1px solid rgba(8, 104, 79, .11);
  border-radius: 21px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 17px 46px rgba(18, 77, 56, .075);
}

body.auth-branded .title {
  margin: 0 0 8px;
  color: #18342b;
  font: 800 clamp(25px, 2.8vw, 31px)/1.17 'Manrope', sans-serif;
  letter-spacing: -.045em;
}

body.auth-branded .auth-kicker {
  display: block;
  margin-bottom: 8px;
  color: #078966;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: none;
}

body.auth-branded .subtitle {
  color: #687b72;
}

body.auth-branded .auth-subtitle {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
}

body.auth-branded .auth-card label:not(.legal-consent) {
  display: block;
  margin: 14px 0 6px;
  color: #344e42;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

body.auth-branded .auth-card input:not([type="checkbox"]):not([type="radio"]),
body.auth-branded .auth-card select,
body.auth-branded .auth-card textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid #dce9e1;
  border-radius: 9px;
  outline: 0;
  background: #fbfefc;
  color: #18342b;
  font: 13px 'DM Sans', sans-serif;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

body.auth-branded .auth-card textarea {
  min-height: 66px;
  resize: vertical;
}

body.auth-branded .auth-card input::placeholder,
body.auth-branded .auth-card textarea::placeholder {
  color: #91a198;
}

body.auth-branded .auth-card input:focus,
body.auth-branded .auth-card select:focus,
body.auth-branded .auth-card textarea:focus {
  border-color: #078966;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(7, 137, 102, .12);
}

body.auth-branded .auth-card input[type="radio"],
body.auth-branded .auth-card input[type="checkbox"] {
  accent-color: #078966;
}

body.auth-branded .auth-card .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  padding: 10px 18px;
  border: 0;
  border-radius: 9px;
  background: #078966;
  color: #fff;
  box-shadow: 0 5px 12px rgba(7, 137, 102, .17);
  font: 800 13px 'DM Sans', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

body.auth-branded .auth-card .btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #08684f;
  box-shadow: 0 8px 16px rgba(7, 137, 102, .2);
}

body.auth-branded .auth-card .btn:focus-visible,
body.auth-branded .lang-btn:focus-visible,
body.auth-branded a:focus-visible {
  outline: 3px solid rgba(7, 137, 102, .32);
  outline-offset: 3px;
}

body.auth-branded .auth-card .btn:disabled {
  background: #9db8aa;
  box-shadow: none;
  cursor: not-allowed;
}

body.auth-branded .auth-card .forgot-password-link {
  display: block;
  width: fit-content;
  margin: 10px 0 0 auto;
  color: #08684f;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

body.auth-branded .auth-card .forgot-password-link:hover,
body.auth-branded .auth-switch a:hover,
body.auth-branded .legal-consent a:hover {
  text-decoration: underline;
}

body.auth-branded .auth-switch {
  margin: 18px 0 0;
  color: #6a7b72;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

body.auth-branded .auth-switch a,
body.auth-branded .legal-consent a,
body.auth-branded .forgot-password-link,
body.auth-branded .app-container > main.app-box .link {
  color: #08684f;
  font-weight: 700;
}

body.auth-branded .legal-consent {
  display: block;
  margin: 0;
  color: #596d62;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0;
  line-height: 1.65;
  text-transform: none;
}

body.auth-branded .legal-consent-card {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  margin: 20px 0 0;
  padding: 16px;
  border: 1px solid #d7e7dc;
  border-radius: 13px;
  background: #f5faf6;
}

body.auth-branded .legal-consent-card > input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #078966;
  cursor: pointer;
}

body.auth-branded .legal-consent-card .legal-consent a {
  position: relative;
  z-index: 2;
  display: inline;
  padding: 2px 0;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.auth-branded .legal-consent-card:focus-within {
  border-color: #078966;
  box-shadow: 0 0 0 3px rgba(7, 137, 102, .1);
}

body.auth-branded .field-help {
  margin: 6px 0 0;
  color: #76877f;
  font-size: 10px;
  line-height: 1.45;
}

body.auth-branded .google-signin-wrap {
  margin-top: 18px;
}

body.auth-branded .google-divider {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 16px 0;
}

body.auth-branded .google-divider::before,
body.auth-branded .google-divider::after {
  height: 1px;
  flex: 1;
  background: #e3ece6;
  content: "";
}

body.auth-branded .google-divider span {
  color: #7b8981;
  font-size: 10px;
}

body.auth-branded .recovery-card .auth-kicker {
  margin-bottom: 8px;
}

body.auth-branded .recovery-step {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 17px 0 6px;
  color: #344e42;
  font-size: 11px;
  font-weight: 700;
}

body.auth-branded .recovery-step span:first-child {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: #e6f5ed;
  color: #08684f;
  font-size: 9px;
  font-weight: 800;
}

body.auth-branded .role-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 13px;
  margin: 0 0 10px;
  border: 1px solid #dce9e1;
  border-radius: 11px;
  background: #fbfefc;
  color: #08684f;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, border-color .16s ease;
}

body.auth-branded .role-option:hover,
body.auth-branded .role-option.selected {
  border-color: #078966;
  background: #e6f5ed;
}

body.auth-branded .role-option.selected {
  box-shadow: 0 0 0 1px #078966;
}

body.auth-branded .role-option span {
  color: #08684f;
  font-size: 13px;
  font-weight: 700;
}

body.auth-branded .role-chooser-overlay {
  position: fixed !important;
  z-index: 1000;
  inset: 0;
  overflow: auto;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 46, 35, .48);
  backdrop-filter: blur(5px);
}

body.auth-branded .role-chooser-box,
body.auth-branded .safi-confirm-dialog {
  width: min(100%, 460px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  padding: 27px;
  border: 1px solid rgba(8, 104, 79, .12);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 65px rgba(14, 58, 42, .2);
}

body.auth-branded .role-chooser-box h2,
body.auth-branded .safi-confirm-dialog h2 {
  color: #18342b;
  font: 800 22px/1.2 'Manrope', sans-serif;
}

body.auth-branded .role-chooser-box .subtitle,
body.auth-branded .safi-confirm-dialog p {
  color: #687b72;
  font-size: 13px;
  line-height: 1.6;
}

body.auth-branded .safi-confirm-backdrop {
  position: fixed !important;
  z-index: 1100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 46, 35, .47);
  backdrop-filter: blur(4px);
}

body.auth-branded .safi-confirm-backdrop.is-visible {
  display: flex;
}

body.auth-branded .safi-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

body.auth-branded .safi-confirm-actions .btn {
  flex: 1;
  min-height: 43px;
  margin: 0;
}

body.auth-branded .safi-confirm-actions .btn-secondary {
  border: 1px solid #b9d9c8;
  background: #e6f5ed;
  color: #08684f;
  box-shadow: none;
}

body.auth-branded #status,
body.auth-branded .form-message {
  min-height: 1.5em;
  line-height: 1.65;
}

body.auth-branded #status[data-state="error"],
body.auth-branded .form-message[data-state="error"] {
  color: #a12d28 !important;
}

body.auth-branded #status[data-state="success"],
body.auth-branded .form-message[data-state="success"] {
  color: #08684f !important;
}

body.auth-branded .app-container > main.app-box {
  text-align: left !important;
}

body.auth-branded .app-container > main.app-box .title {
  margin-bottom: 10px;
}

body.auth-branded .app-container > main.app-box .btn {
  display: inline-flex !important;
  width: auto;
  padding-right: 22px;
  padding-left: 22px;
}

body.auth-branded .app-container > main.app-box .link {
  display: inline-block;
  margin-top: 12px;
  text-decoration: none;
}

/* A tighter, app-like mobile composition matching the supplied phone screens. */
@media (max-width: 760px) {
  body.auth-branded {
    background:
      radial-gradient(circle at 3% 4%, rgba(176, 230, 199, .56), transparent 28%),
      radial-gradient(circle at 100% 94%, rgba(194, 237, 211, .72), transparent 31%),
      linear-gradient(180deg, #f5fbf7, #eff9f3 78%, #e7f5ed);
  }

  body.auth-branded .app-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: min(100% - 32px, 470px);
    min-height: 100dvh;
    margin: 0 auto;
    padding: 12px 0 30px;
  }

  body.auth-branded .top-row {
    position: relative;
    order: 0;
    width: 100%;
    min-height: 45px;
    margin: 0 0 17px;
    padding: 0 2px;
    border: 0 !important;
  }

  body.auth-branded .top-row > .brand-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  body.auth-branded .top-row > .lang-toggle {
    margin-left: auto;
  }

  body.auth-branded .auth-page .top-row .brand-logo {
    font-size: 14px;
  }

  body.auth-branded .auth-brand-panel {
    display: none;
  }

  body.auth-branded .auth-card,
  body.auth-branded .app-container > main.app-box {
    position: relative;
    order: 1;
    overflow: hidden;
    padding: 25px 23px 24px;
    border: 1px solid rgba(14, 99, 69, .1);
    border-radius: 19px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 12px 32px rgba(24, 83, 59, .08);
  }

  body.auth-branded .auth-card::before {
    position: absolute;
    top: -74px;
    right: -66px;
    width: 155px;
    height: 155px;
    border: 1px solid rgba(7, 137, 102, .11);
    border-radius: 50%;
    box-shadow: 0 0 0 16px rgba(230, 245, 237, .55), 0 0 0 33px rgba(7, 137, 102, .03);
    content: "";
    pointer-events: none;
  }

  body.auth-branded .auth-card > *,
  body.auth-branded .app-container > main.app-box > * {
    position: relative;
    z-index: 1;
  }

  body.auth-branded .title {
    font-size: clamp(24px, 7vw, 29px);
  }

  body.auth-branded .auth-subtitle {
    margin-bottom: 17px;
    font-size: 12px;
  }

  body.auth-branded .auth-card label:not(.legal-consent) {
    margin-top: 14px;
    font-size: 13px;
  }

  body.auth-branded .auth-card input:not([type="checkbox"]):not([type="radio"]),
  body.auth-branded .auth-card select,
  body.auth-branded .auth-card textarea {
    min-height: 41px;
    padding: 9px 11px;
    font-size: 12px;
  }

  body.auth-branded .auth-card .btn {
    min-height: 41px;
    margin-top: 16px;
  }

  body.auth-branded .auth-switch {
    margin-top: 15px;
  }

  body.auth-branded .role-chooser-box,
  body.auth-branded .safi-confirm-dialog {
    padding: 23px 20px;
    border-radius: 17px;
  }

  body.auth-branded .app-container > main.app-box .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  body.auth-branded .app-container {
    width: min(100% - 22px, 470px);
    padding-top: 9px;
  }

  body.auth-branded .top-row {
    margin-bottom: 12px;
  }

  body.auth-branded .auth-card,
  body.auth-branded .app-container > main.app-box {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (min-width: 761px) {
  body.auth-branded .auth-card,
  body.auth-branded .app-container > main.app-box {
    align-self: start;
  }

  body.auth-branded .app-container > main.app-box {
    text-align: left !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-branded *,
  body.auth-branded *::before,
  body.auth-branded *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Tablet composition: keep the brand present without squeezing long forms. */
@media (min-width: 761px) and (max-width: 940px) {
  body.auth-branded .app-container {
    display: grid;
    grid-template-columns: minmax(0, 620px);
    grid-template-rows: auto auto auto;
    justify-content: center;
    gap: 0;
    width: min(100% - 48px, 620px);
    min-height: 0;
    margin: 24px auto 40px;
  }

  body.auth-branded .top-row {
    grid-column: 1;
    grid-row: 1;
    margin: 0 0 14px;
  }

  body.auth-branded .auth-brand-panel {
    grid-column: 1;
    grid-row: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px 20px;
    min-height: 0;
    padding: 20px 24px;
    border-radius: 18px 18px 0 0;
    box-shadow: none;
  }

  body.auth-branded .auth-brand-panel .brand-logo {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    font-size: 14px;
  }

  body.auth-branded .auth-brand-panel .brand-mark-small {
    width: 30px;
    height: 30px;
  }

  body.auth-branded .auth-brand-copy {
    grid-column: 2;
    grid-row: 1 / span 2;
    max-width: none;
    margin: 0;
  }

  body.auth-branded .auth-brand-eyebrow {
    margin-bottom: 7px;
    font-size: 9px;
  }

  body.auth-branded .auth-brand-copy h2 {
    margin-bottom: 5px;
    font-size: clamp(20px, 3vw, 27px);
  }

  body.auth-branded .auth-brand-copy p {
    max-width: 480px;
    font-size: 12px;
    line-height: 1.55;
  }

  body.auth-branded .auth-brand-foot {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    font-size: 9px;
  }

  body.auth-branded .auth-card,
  body.auth-branded .app-container > main.app-box {
    grid-column: 1;
    grid-row: 3;
    padding: 30px clamp(28px, 5vw, 42px);
    border-radius: 0 0 18px 18px;
  }
}

/* Phone controls retain comfortable hit targets while signup stays compact. */
@media (max-width: 760px) {
  body.auth-branded .auth-card label:not(.legal-consent) {
    font-size: 11px;
  }

  body.auth-branded .auth-card input:not([type="checkbox"]):not([type="radio"]),
  body.auth-branded .auth-card select,
  body.auth-branded .auth-card textarea {
    min-height: 44px;
    font-size: 14px;
  }

  body.auth-branded .auth-card .btn {
    min-height: 46px;
    font-size: 14px;
  }

  body.auth-branded .legal-consent {
    font-size: 13px;
  }

  body.auth-branded .legal-consent-card {
    gap: 11px;
    margin-top: 19px;
    padding: 15px 13px;
  }

  body.auth-branded .legal-consent-card > input[type="checkbox"] {
    width: 22px;
    height: 22px;
  }

  body.auth-branded .field-help {
    font-size: 11px;
  }

  body.auth-branded .auth-switch,
  body.auth-branded .auth-card .forgot-password-link {
    font-size: 12px;
  }
}

/* Honor the application's persisted theme without changing auth semantics. */
:root[data-theme="dark"] body.auth-branded {
  --bg: #13241d;
  --bg-soft: #1a3027;
  --bg-card: #1d3028;
  --bg-card-glass: #1d3028;
  --bg-input-glass: #172920;
  --text: #e7f3eb;
  --muted: #b1c5b8;
  --border: rgba(199, 233, 211, .17);
  --border-strong: rgba(199, 233, 211, .27);
  --shadow-card: 0 18px 48px rgba(0, 0, 0, .24);
  color-scheme: dark;
  background:
    radial-gradient(ellipse at 8% 6%, rgba(38, 102, 71, .3), transparent 31%),
    radial-gradient(ellipse at 94% 93%, rgba(28, 81, 57, .3), transparent 34%),
    #13241d;
}

:root[data-theme="dark"] body.auth-branded .top-row {
  border-bottom-color: rgba(199, 233, 211, .14) !important;
}

:root[data-theme="dark"] body.auth-branded .brand-logo,
:root[data-theme="dark"] body.auth-branded .title,
:root[data-theme="dark"] body.auth-branded .auth-card label:not(.legal-consent),
:root[data-theme="dark"] body.auth-branded .recovery-step {
  color: #e7f3eb;
}

:root[data-theme="dark"] body.auth-branded .auth-card,
:root[data-theme="dark"] body.auth-branded .app-container > main.app-box {
  border-color: rgba(199, 233, 211, .14);
  background: #1d3028;
  box-shadow: 0 17px 46px rgba(0, 0, 0, .22);
}

:root[data-theme="dark"] body.auth-branded .subtitle,
:root[data-theme="dark"] body.auth-branded .auth-switch,
:root[data-theme="dark"] body.auth-branded .legal-consent {
  color: #b1c5b8;
}

:root[data-theme="dark"] body.auth-branded .legal-consent-card {
  border-color: #3d5a4a;
  background: #172920;
}

:root[data-theme="dark"] body.auth-branded .legal-consent-card:focus-within {
  border-color: #75c798;
  box-shadow: 0 0 0 3px rgba(117, 199, 152, .14);
}

/* The card itself is the surface; its text label must not draw a second box. */
body.auth-page.auth-branded .auth-card .legal-consent-card .legal-consent {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.55;
}

:root[data-theme="dark"] body.auth-branded .auth-switch a,
:root[data-theme="dark"] body.auth-branded .legal-consent a,
:root[data-theme="dark"] body.auth-branded .forgot-password-link,
:root[data-theme="dark"] body.auth-branded .app-container > main.app-box .link {
  color: #9fe0b8;
}

:root[data-theme="dark"] body.auth-branded .auth-card input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="dark"] body.auth-branded .auth-card select,
:root[data-theme="dark"] body.auth-branded .auth-card textarea {
  border-color: #3d5a4a;
  background: #172920;
  color: #edf7f0;
}

:root[data-theme="dark"] body.auth-branded .auth-card input::placeholder,
:root[data-theme="dark"] body.auth-branded .auth-card textarea::placeholder {
  color: #9bb3a4;
}

:root[data-theme="dark"] body.auth-branded .lang-toggle {
  border-color: rgba(199, 233, 211, .2);
  background: #1d3028;
}

:root[data-theme="dark"] body.auth-branded .lang-btn {
  color: #b1c5b8;
}

:root[data-theme="dark"] body.auth-branded .lang-btn.active,
:root[data-theme="dark"] body.auth-branded .lang-btn[aria-pressed="true"],
:root[data-theme="dark"] body.auth-branded .recovery-step span:first-child {
  background: #244838;
  color: #bce8cd;
}

:root[data-theme="dark"] body.auth-branded .role-option {
  border-color: #3d5a4a;
  background: #172920;
  color: #d5ebdd;
}

:root[data-theme="dark"] body.auth-branded .role-option span {
  color: #d5ebdd;
}

:root[data-theme="dark"] body.auth-branded .role-option:hover,
:root[data-theme="dark"] body.auth-branded .role-option.selected {
  border-color: #55bd88;
  background: #244838;
}

:root[data-theme="dark"] body.auth-branded .role-chooser-box,
:root[data-theme="dark"] body.auth-branded .safi-confirm-dialog {
  border-color: #3d5a4a;
  background: #1d3028;
}

:root[data-theme="dark"] body.auth-branded .role-chooser-box h2,
:root[data-theme="dark"] body.auth-branded .safi-confirm-dialog h2 {
  color: #edf7f0;
}

:root[data-theme="dark"] body.auth-branded .role-chooser-box .subtitle,
:root[data-theme="dark"] body.auth-branded .safi-confirm-dialog p {
  color: #b1c5b8;
}

:root[data-theme="dark"] body.auth-branded .safi-confirm-actions .btn-secondary {
  border-color: #496b58;
  background: #244838;
  color: #d5ebdd;
}

:root[data-theme="dark"] body.auth-branded .google-divider::before,
:root[data-theme="dark"] body.auth-branded .google-divider::after {
  background: #3d5a4a;
}

:root[data-theme="dark"] body.auth-branded .google-divider span {
  color: #b1c5b8;
}

:root[data-theme="dark"] body.auth-branded .auth-card .btn:disabled {
  background: #496b58;
  color: #e7f3eb;
}

:root[data-theme="dark"] body.auth-branded #status[data-state="success"],
:root[data-theme="dark"] body.auth-branded .form-message[data-state="success"] {
  color: #9fe0b8 !important;
}

:root[data-theme="dark"] body.auth-branded #status[data-state="error"],
:root[data-theme="dark"] body.auth-branded .form-message[data-state="error"] {
  color: #ffaaa2 !important;
}

:root[data-theme="dark"] body.account-page.auth-branded .top-row > .link,
:root[data-theme="dark"] body.account-page.auth-branded #loginLink {
  color: #a7e6be !important;
}

/* Company service choices: compact cards rather than full-width form inputs. */
body.auth-branded .auth-card #companyServices { margin: 16px 0 4px; }
body.auth-branded .auth-card .company-services-heading {
  margin: 0 0 9px;
  color: #244839;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}
body.auth-branded .auth-card #companyServiceOptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
body.auth-branded .auth-card #companyServiceOptions .company-service-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin: 0;
  padding: 7px 10px;
  border: 1px solid #dbe9df;
  border-radius: 10px;
  background: #f9fcfa;
  color: #29493a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
body.auth-branded .auth-card #companyServiceOptions .company-service-option input[type="checkbox"] {
  box-sizing: border-box;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: #087553;
  cursor: pointer;
}
body.auth-branded .auth-card #companyServiceOptions .company-service-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
body.auth-branded .auth-card #companyServiceOptions .company-service-option:has(input:checked) {
  border-color: #198967;
  background: #eaf6ee;
  color: #16573f;
}
body.auth-branded .auth-card #companyServiceOptions .company-service-option:focus-within {
  outline: 2px solid #198967;
  outline-offset: 2px;
}
:root[data-theme="dark"] body.auth-branded .auth-card .company-services-heading { color: #e6f4e9; }
:root[data-theme="dark"] body.auth-branded .auth-card #companyServiceOptions .company-service-option {
  border-color: #3d5a4a;
  background: #172920;
  color: #d8eee0;
}
:root[data-theme="dark"] body.auth-branded .auth-card #companyServiceOptions .company-service-option:has(input:checked) {
  border-color: #80d3a5;
  background: #244838;
  color: #e8f8eb;
}