:root {
  --rr-auth-page: #edf4fc;
  --rr-auth-surface: #ffffff;
  --rr-auth-surface-soft: #f7faff;
  --rr-auth-text: #15243b;
  --rr-auth-muted: #6a7a90;
  --rr-auth-border: #d9e5f2;
  --rr-auth-primary: #2563eb;
  --rr-auth-navy: #0d3b76;
  --rr-auth-shadow: 0 28px 80px rgba(13,59,118,.16);
}

html[data-rr-theme="dark"] {
  color-scheme: dark;
  --rr-auth-page: #071421;
  --rr-auth-surface: #0e2034;
  --rr-auth-surface-soft: #132842;
  --rr-auth-text: #f5f9ff;
  --rr-auth-muted: #afc0d4;
  --rr-auth-border: #294564;
  --rr-auth-shadow: 0 30px 90px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html, body { min-width: 320px; }
body.rr-auth-estate-body {
  min-height: 100vh;
  margin: 0;
  color: var(--rr-auth-text);
  background:
    linear-gradient(rgba(37,99,235,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.028) 1px, transparent 1px),
    var(--rr-auth-page);
  background-size: 34px 34px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.rr-auth-estate-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px clamp(18px,4vw,54px);
  border-bottom: 1px solid var(--rr-auth-border);
  background: color-mix(in srgb, var(--rr-auth-surface) 92%, transparent);
  backdrop-filter: blur(18px);
}

.rr-auth-estate-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--rr-auth-text);
  text-decoration: none;
}

.rr-auth-estate-brand > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg,#4d98e6,#174e91);
  box-shadow: 0 12px 26px rgba(37,99,235,.20);
}

.rr-auth-estate-brand > div { display: grid; line-height: 1.1; }
.rr-auth-estate-brand strong { font-size: 1rem; }
.rr-auth-estate-brand small { color: var(--rr-auth-muted); font-size: .58rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }

.rr-auth-estate-header-actions { display: flex; align-items: center; gap: 9px; }
.rr-auth-estate-header-actions > a,
.rr-auth-estate-theme {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--rr-auth-border);
  border-radius: 10px;
  color: var(--rr-auth-text);
  background: var(--rr-auth-surface);
  font-size: .68rem;
  font-weight: 750;
  text-decoration: none;
}
.rr-auth-estate-theme { cursor: pointer; }

.rr-auth-estate-shell {
  width: min(1380px, calc(100% - 44px));
  min-height: calc(100vh - 132px);
  display: grid;
  grid-template-columns: minmax(0,1.25fr) minmax(390px,.75fr);
  overflow: hidden;
  margin: 28px auto;
  border: 1px solid var(--rr-auth-border);
  border-radius: 26px;
  background: var(--rr-auth-surface);
  box-shadow: var(--rr-auth-shadow);
}

.rr-auth-estate-visual {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  background: #164b82;
}

.rr-auth-estate-visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.rr-auth-estate-visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5,23,47,.82), rgba(7,34,68,.38) 62%, rgba(7,34,68,.15)),
    linear-gradient(180deg, rgba(7,20,33,.12), rgba(4,20,39,.52));
}

.rr-auth-estate-glass {
  position: absolute;
  left: clamp(24px,5vw,62px);
  top: 50%;
  width: min(610px, calc(100% - 48px));
  transform: translateY(-50%);
  padding: clamp(27px,4vw,48px);
  border: 1px solid rgba(255,255,255,.27);
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
  box-shadow: 0 30px 80px rgba(0,0,0,.24);
  backdrop-filter: blur(18px) saturate(125%);
}

.rr-auth-estate-kicker {
  display: block;
  margin-bottom: 14px;
  color: #cfe7ff;
  font-size: .67rem;
  font-weight: 830;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.rr-auth-estate-glass h1 {
  max-width: 560px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.35rem,5vw,4.45rem);
  font-weight: 850;
  letter-spacing: -.06em;
  line-height: .98;
}

.rr-auth-estate-glass > p {
  max-width: 560px;
  margin: 20px 0 0;
  color: rgba(255,255,255,.78);
  line-height: 1.72;
}

.rr-auth-estate-benefits {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.rr-auth-estate-benefits article {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 13px;
  background: rgba(255,255,255,.08);
}

.rr-auth-estate-benefits article > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 11px;
  background: rgba(255,255,255,.13);
}

.rr-auth-estate-benefits article span { display: grid; }
.rr-auth-estate-benefits article strong { font-size: .73rem; }
.rr-auth-estate-benefits article small { color: rgba(255,255,255,.64); font-size: .63rem; }

.rr-auth-estate-property-glass {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 14px;
  color: #fff;
  background: rgba(7,31,61,.62);
  backdrop-filter: blur(15px);
}

.rr-auth-estate-property-glass > i {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.13);
}
.rr-auth-estate-property-glass span { display: grid; }
.rr-auth-estate-property-glass small { color: #bcdcff; font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; }
.rr-auth-estate-property-glass strong { font-size: .71rem; }

.rr-auth-estate-panel {
  display: grid;
  align-items: center;
  padding: clamp(28px,4vw,58px);
  background: var(--rr-auth-surface);
}

.rr-auth-estate-panel-inner {
  width: min(100%,470px);
  margin-inline: auto;
}

.rr-auth-estate-panel-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 30px;
}

.rr-auth-estate-panel-brand > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg,#4d98e6,#174e91);
  font-weight: 850;
}
.rr-auth-estate-panel-brand > div { display: grid; }
.rr-auth-estate-panel-brand strong { color: var(--rr-auth-text); }
.rr-auth-estate-panel-brand small { color: var(--rr-auth-muted); font-size: .65rem; }

/* Existing login and setup partials */
.rr-auth-estate-panel .rr-portal-login-heading { margin-bottom: 24px !important; }
.rr-auth-estate-panel .rr-portal-eyebrow { margin: 0 0 8px !important; color: var(--rr-auth-primary) !important; font-size: .65rem !important; font-weight: 820 !important; letter-spacing: .11em !important; text-transform: uppercase !important; }
.rr-auth-estate-panel .rr-portal-login-heading h2 { margin: 0 !important; color: var(--rr-auth-text) !important; font-size: clamp(2rem,4vw,3rem) !important; font-weight: 850 !important; letter-spacing: -.045em !important; }
.rr-auth-estate-panel .rr-portal-login-heading > p:last-child { margin: 10px 0 0 !important; color: var(--rr-auth-muted) !important; line-height: 1.65 !important; }
.rr-auth-estate-panel .rr-portal-alert { display: flex !important; align-items: flex-start !important; gap: 9px !important; border-radius: 12px !important; }
.rr-auth-estate-panel .rr-portal-login-form { display: grid !important; gap: 17px !important; }
.rr-auth-estate-panel .rr-portal-field { display: grid !important; gap: 7px !important; }
.rr-auth-estate-panel .rr-portal-field label { color: var(--rr-auth-text) !important; font-size: .7rem !important; font-weight: 770 !important; }
.rr-auth-estate-panel .rr-portal-input-wrap { position: relative !important; display: flex !important; align-items: center !important; }
.rr-auth-estate-panel .rr-portal-input-wrap > i { position: absolute !important; left: 14px !important; z-index: 2 !important; color: var(--rr-auth-primary) !important; }
.rr-auth-estate-panel .rr-portal-input-wrap .form-control {
  min-height: 49px !important;
  padding-left: 42px !important;
  padding-right: 43px !important;
  border: 1px solid var(--rr-auth-border) !important;
  border-radius: 11px !important;
  color: var(--rr-auth-text) !important;
  background: var(--rr-auth-surface-soft) !important;
  box-shadow: none !important;
}
.rr-auth-estate-panel .rr-portal-input-wrap .form-control:focus { border-color: #76a7dc !important; box-shadow: 0 0 0 .22rem rgba(37,99,235,.13) !important; }
.rr-auth-estate-panel .rr-portal-password-toggle { position: absolute !important; right: 8px !important; width: 35px !important; height: 35px !important; display: grid !important; place-items: center !important; border: 0 !important; border-radius: 9px !important; color: var(--rr-auth-muted) !important; background: transparent !important; }
.rr-auth-estate-panel .rr-portal-login-button {
  min-height: 49px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 17px !important;
  border: 0 !important;
  border-radius: 11px !important;
  color: #fff !important;
  background: linear-gradient(135deg,#2563eb,#174e91) !important;
  box-shadow: 0 13px 30px rgba(37,99,235,.20) !important;
  font-weight: 790 !important;
}
.rr-auth-estate-panel .rr-portal-login-divider { position: relative !important; margin: 24px 0 !important; text-align: center !important; }
.rr-auth-estate-panel .rr-portal-login-divider::before { position: absolute !important; left: 0 !important; right: 0 !important; top: 50% !important; height: 1px !important; content: "" !important; background: var(--rr-auth-border) !important; }
.rr-auth-estate-panel .rr-portal-login-divider span { position: relative !important; padding: 0 10px !important; color: var(--rr-auth-muted) !important; background: var(--rr-auth-surface) !important; font-size: .62rem !important; }
.rr-auth-estate-panel .rr-portal-login-links { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 12px !important; flex-wrap: wrap !important; }
.rr-auth-estate-panel .rr-portal-login-links a,
.rr-auth-estate-panel .rr-client-login-install-link a { display: inline-flex !important; align-items: center !important; gap: 6px !important; color: var(--rr-auth-primary) !important; font-size: .68rem !important; font-weight: 750 !important; text-decoration: none !important; }
.rr-auth-estate-panel .rr-client-login-install-link { margin-top: 18px !important; padding-top: 18px !important; border-top: 1px solid var(--rr-auth-border) !important; }

.rr-auth-estate-trust { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rr-auth-border); color: var(--rr-auth-muted); font-size: .62rem; }
.rr-auth-estate-trust span { display: inline-flex; align-items: center; gap: 5px; }
.rr-auth-estate-trust i { color: var(--rr-auth-primary); }

.rr-auth-estate-footer {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(18px,4vw,54px);
  color: var(--rr-auth-muted);
  font-size: .61rem;
}

html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-portal-input-wrap .form-control { background: #10243b !important; }
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-portal-login-divider span { background: var(--rr-auth-surface) !important; }
html[data-rr-theme="dark"] .rr-auth-estate-panel :where(h1,h2,h3,strong,label) { color: #f5f9ff !important; }
html[data-rr-theme="dark"] .rr-auth-estate-panel :where(p,small,.text-muted) { color: #afc0d4 !important; }

@media (max-width: 1050px) {
  .rr-auth-estate-shell { grid-template-columns: 1fr; }
  .rr-auth-estate-visual { min-height: 520px; }
  .rr-auth-estate-glass { width: min(640px,calc(100% - 48px)); }
}

@media (max-width: 767.98px) {
  .rr-auth-estate-header { min-height: 68px; padding: 11px 14px; }
  .rr-auth-estate-header-actions > a { display: none; }
  .rr-auth-estate-theme span { display: none; }
  .rr-auth-estate-theme { width: 40px; padding: 0; }
  .rr-auth-estate-shell { width: min(100% - 22px,1380px); margin: 14px auto; border-radius: 20px; }
  .rr-auth-estate-visual { min-height: 460px; }
  .rr-auth-estate-glass { left: 16px; width: calc(100% - 32px); padding: 23px; border-radius: 19px; }
  .rr-auth-estate-glass h1 { font-size: clamp(2.15rem,11vw,3.4rem); }
  .rr-auth-estate-benefits article:nth-child(n+3) { display: none; }
  .rr-auth-estate-property-glass { display: none; }
  .rr-auth-estate-panel { padding: 30px 20px; }
  .rr-auth-estate-footer { align-items: flex-start; flex-direction: column; justify-content: center; padding: 14px; }
}

@media (max-width: 520px) {
  .rr-auth-estate-brand small { display: none; }
  .rr-auth-estate-visual { min-height: 420px; }
  .rr-auth-estate-glass > p { display: none; }
  .rr-auth-estate-benefits { margin-top: 20px; }
  .rr-auth-estate-panel .rr-portal-login-links { align-items: flex-start !important; flex-direction: column !important; }
}

/* ================================================================
   SETUP + CLIENT REGISTRATION — FINAL LATE OVERRIDES
   This stylesheet is linked again after rendered view content so old
   inline authentication styles cannot restore the previous dark/AI look.
   ================================================================ */
.rr-auth-estate-panel .rr-kicker,
.rr-auth-estate-panel .rr-portal-eyebrow {
  margin: 0 0 .55rem !important;
  color: #1d63c7 !important;
  font-size: .74rem !important;
  font-weight: 850 !important;
  letter-spacing: .13em !important;
  text-transform: uppercase !important;
}

.rr-auth-estate-panel .rr-auth-title,
.rr-auth-estate-panel .rr-portal-login-heading h2 {
  margin: 0 !important;
  color: #102a4c !important;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: clamp(1.8rem, 4vw, 2.55rem) !important;
  font-weight: 850 !important;
  letter-spacing: -.045em !important;
  line-height: 1.05 !important;
}

.rr-auth-estate-panel .rr-portal-login-heading > p:last-child,
.rr-auth-estate-panel .text-secondary,
.rr-auth-estate-panel .form-text {
  color: #64748b !important;
}

.rr-auth-estate-panel .rr-form,
.rr-auth-estate-panel .rr-client-register-form {
  display: grid !important;
  gap: 1rem !important;
}

.rr-auth-estate-panel .form-label,
.rr-auth-estate-panel .rr-portal-field label {
  margin-bottom: .42rem !important;
  color: #243b5a !important;
  font-size: .82rem !important;
  font-weight: 780 !important;
}

.rr-auth-estate-panel .form-control,
.rr-auth-estate-panel .form-select,
.rr-auth-estate-panel .rr-control {
  min-height: 50px !important;
  border: 1px solid #d9e4f2 !important;
  border-radius: 13px !important;
  background: #f8fbff !important;
  color: #142c4d !important;
  box-shadow: none !important;
}

.rr-auth-estate-panel .form-control::placeholder,
.rr-auth-estate-panel .rr-control::placeholder {
  color: #91a0b4 !important;
}

.rr-auth-estate-panel .form-control:focus,
.rr-auth-estate-panel .form-select:focus,
.rr-auth-estate-panel .rr-control:focus {
  border-color: #2f73d8 !important;
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(47,115,216,.12) !important;
}

.rr-auth-estate-panel .rr-btn-dark,
.rr-auth-estate-panel .rr-portal-login-button {
  display: inline-flex !important;
  min-height: 52px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .65rem !important;
  border: 0 !important;
  border-radius: 13px !important;
  background: linear-gradient(135deg, #1b65c9, #0d3b76) !important;
  color: #fff !important;
  font-weight: 850 !important;
  box-shadow: 0 16px 30px rgba(13,59,118,.2) !important;
}

.rr-auth-estate-panel .rr-btn-dark:hover,
.rr-auth-estate-panel .rr-portal-login-button:hover {
  transform: translateY(-1px) !important;
  filter: brightness(1.05) !important;
}

.rr-auth-estate-panel .rr-auth-footer,
.rr-auth-estate-panel .rr-portal-login-divider,
.rr-auth-estate-panel .rr-portal-login-links {
  color: #64748b !important;
}

.rr-auth-estate-panel .rr-auth-footer a,
.rr-auth-estate-panel .rr-portal-login-links a {
  color: #1d63c7 !important;
  font-weight: 800 !important;
}

.rr-auth-estate-panel .rr-client-register-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: .9rem !important;
}

.rr-auth-estate-panel .rr-client-register-full {
  grid-column: 1 / -1 !important;
}

.rr-auth-estate-panel .rr-client-register-password-rules {
  color: #738399 !important;
}

.rr-auth-estate-panel .rr-client-register-password-rules li.is-valid {
  color: #16835a !important;
}

.rr-auth-estate-panel .rr-client-register-privacy {
  color: #5f7188 !important;
}

.rr-auth-estate-panel .alert {
  border: 0 !important;
  border-radius: 13px !important;
}

html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-kicker,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-portal-eyebrow {
  color: #82b7ff !important;
}

html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-auth-title,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-portal-login-heading h2,
html[data-rr-theme="dark"] .rr-auth-estate-panel .form-label,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-portal-field label {
  color: #f8fbff !important;
}

html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-portal-login-heading > p:last-child,
html[data-rr-theme="dark"] .rr-auth-estate-panel .text-secondary,
html[data-rr-theme="dark"] .rr-auth-estate-panel .form-text,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-auth-footer,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-portal-login-divider,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-client-register-privacy,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-client-register-password-rules {
  color: #a9b9cc !important;
}

html[data-rr-theme="dark"] .rr-auth-estate-panel .form-control,
html[data-rr-theme="dark"] .rr-auth-estate-panel .form-select,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-control {
  border-color: #315074 !important;
  background: #102641 !important;
  color: #fff !important;
}

html[data-rr-theme="dark"] .rr-auth-estate-panel .form-control:focus,
html[data-rr-theme="dark"] .rr-auth-estate-panel .form-select:focus,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-control:focus {
  border-color: #78adf4 !important;
  background: #142d4b !important;
  box-shadow: 0 0 0 4px rgba(120,173,244,.16) !important;
}

html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-auth-footer a,
html[data-rr-theme="dark"] .rr-auth-estate-panel .rr-portal-login-links a {
  color: #8bbcff !important;
}

@media (max-width: 700px) {
  .rr-auth-estate-panel .rr-client-register-grid {
    grid-template-columns: 1fr !important;
  }

  .rr-auth-estate-panel .rr-client-register-full {
    grid-column: auto !important;
  }
}
