/* ===== Control Room redesign (19 Oct 2026): signing in and the outside world. The sign-in, Forgot password, reset,
   invite, first setup and sign-up pages are one centred card on the plain canvas (prototype Login.dc); Contact us is a
   top bar with the form beside a short intro (Contact.dc). Colours come from the shared variables, so dark mode
   follows. These pages use their own classes (rd-auth / rd-pub, rd-card…), so the older sign-in styles don't apply. ===== */

/* ---------- the page and the card ---------- */
body.rd-auth { height: auto; min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 20px;
  padding: 48px 16px 20px; background: var(--bg); color: var(--ink); }
.rd-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.rd-card [hidden] { display: none !important; }
.rd-head { display: flex; flex-direction: column; gap: 16px; }
.rd-brand { display: flex; align-items: center; }
.rd-brand .brand-link { display: inline-flex; border-radius: 6px; }
.rd-brand .brand-logo { height: 30px; width: auto; display: block; }
.rd-title { display: flex; flex-direction: column; gap: 4px; }
.rd-title h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; color: var(--ink); }
.rd-title .auth-sub { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* ---------- fields and buttons ---------- */
.rd-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.rd-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink); }
.rd-form label small { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--muted); }
.rd-form input:not([type=checkbox]), .rd-form select, .rd-form textarea { width: 100%; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel); color: var(--ink);
  font-size: 14px; font-weight: 400; box-shadow: none; }
.rd-form textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.rd-form select { padding: 0 10px; }
.rd-form input::placeholder, .rd-form textarea::placeholder { color: var(--muted); opacity: .75; }
.rd-form input:not([type=checkbox]):focus, .rd-form select:focus, .rd-form textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.rd-form .pw-wrap > input { padding-right: 44px; }
.rd-card .pw-eye { right: 2px; width: 36px; height: 36px; border-radius: 7px; display: grid; place-items: center; }
/* the two-factor code: big, spaced, centred digits */
.rd-form input.rd-code { height: 46px; font-family: var(--f-mono); font-size: 18px; letter-spacing: .3em; text-align: center; }
.rd-row { display: flex; align-items: center; justify-content: flex-end; margin: -6px 0 0; font-size: 13px; }
.rd-card a:not(.rd-btn):not(.brand-link), .rd-below a, .rd-pub a.rd-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.rd-card a:not(.rd-btn):not(.brand-link):hover, .rd-below a:hover, .rd-pub a.rd-link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.rd-btn { height: 42px; width: 100%; padding: 0 16px; border-radius: 9px; border: 1px solid var(--accent-btn); background: var(--accent-btn);
  color: #fff; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; text-decoration: none; }
.rd-btn:hover { filter: brightness(1.08); color: #fff; }
.rd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd-btn[disabled] { cursor: progress; opacity: .8; filter: none; }
a.rd-btn, a.rd-btn:hover { color: #fff; }
.rd-btn.ghost, a.rd-btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.rd-btn.ghost:hover, a.rd-btn.ghost:hover { background: var(--hover); color: var(--ink); filter: none; }
.rd-card .error { margin: 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.45;
  background: color-mix(in srgb, var(--danger) 10%, var(--panel)); color: var(--danger); }
.rd-done { margin: 0; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.5; font-weight: 500;
  background: color-mix(in srgb, var(--st-done) 12%, var(--panel)); color: color-mix(in srgb, var(--st-done) 70%, var(--ink)); }

/* ---------- under the form, and under the card ---------- */
.rd-foot { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); text-align: center; }
.rd-foot p { margin: 0; }
.rd-below { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; font-size: 12.5px; color: var(--muted); }
.rd-below a { font-weight: 500; }
.rd-auth .powered-by, .rd-pub .powered-by { position: static; margin: auto auto 0; align-self: center; }
.rd-auth .m-install:empty { display: none; }

/* ---------- the second step: two-factor sign-in and Forgot password (auth.js draws it) ---------- */
.rd-card .ab-mfa { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.rd-card .ab-mfa:empty, .rd-card .ab-mfa > div:empty { display: none; }
.rd-card .ab-step { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.rd-card .ab-lead { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.rd-card .ab-note { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.rd-card .ab-center { margin: 0; text-align: center; }
.rd-card .ab-methods { display: flex; flex-direction: column; gap: 8px; }
.rd-card .ab-method { display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 11px 14px; text-align: left;
  border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.rd-card .ab-method:hover { border-color: var(--accent); background: var(--accent-soft); }
.rd-card .ab-method:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rd-card .ab-method b { font-size: 14px; font-weight: 600; }
.rd-card .ab-method small { font-size: 12.5px; color: var(--muted); }
.rd-card .ab-link { align-self: center; min-height: 36px; padding: 4px 8px; border: 0; border-radius: 7px; background: none;
  color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.rd-card .ab-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.rd-card .ab-match { align-self: center; min-width: 96px; padding: 8px 20px; border-radius: 12px; text-align: center;
  font-family: var(--f-mono); font-size: 40px; font-weight: 600; letter-spacing: .06em; color: var(--accent-ink); background: var(--accent-soft); }
.rd-card .ab-wait .ab-note { display: flex; gap: 8px; justify-content: center; align-items: center; text-align: center; }
.rd-card .ab-spin-dark { border-color: color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); }
.rd-card .ab-done { margin: 0; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink);
  background: color-mix(in srgb, var(--st-done) 12%, var(--panel)); }

/* Continue with Google / Microsoft */
.rd-card .ab-alt { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.rd-card .ab-or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.rd-card .ab-or::before, .rd-card .ab-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.rd-card a.ab-sso { height: 42px; display: flex; align-items: center; justify-content: center; gap: 10px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.rd-card a.ab-sso:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.rd-card .ab-sso svg { width: 18px; height: 18px; }

/* ---------- Contact us: a top bar, then the intro beside the form ---------- */
body.rd-pub { height: auto; min-height: 100vh; background: var(--bg); color: var(--ink); }
.rd-top { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
.rd-top .rd-brand { margin-right: auto; }
.rd-top .brand-logo { height: 28px; }
body.rd-pub .rd-top a.rd-nav { font-size: 14px; color: var(--ink); text-decoration: none; padding: 8px 4px; border-radius: 6px; }
body.rd-pub .rd-top a.rd-nav:hover { color: var(--accent); }
.rd-top .rd-btn { width: auto; height: 36px; padding: 0 14px; font-size: 13.5px; }
.rd-contact { width: 100%; max-width: 1040px; margin: 0 auto; padding: 48px 16px; display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.rd-intro { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.rd-intro h1 { margin: 0; font-size: 34px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.rd-intro > p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink); opacity: .88; }
.rd-ways { display: flex; flex-direction: column; gap: 10px; }
.rd-ways:empty { display: none; }
.rd-way { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.rd-way > span { font-size: 12.5px; color: var(--muted); }
.rd-way > b, .rd-way > a { font-size: 15px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.rd-way > p { margin: 0; font-size: 14px; line-height: 1.5; }
.rd-contact .rd-card { flex: 1 1 420px; max-width: none; min-width: 0; padding: 24px; gap: 14px; }
.rd-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.rd-pub .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- phones ---------- */
@media (max-width: 480px) {
  body.rd-auth { padding: 24px 16px 16px; gap: 16px; }
  .rd-card { padding: 22px 18px; }
  .rd-form input:not([type=checkbox]), .rd-form select { height: 44px; font-size: 16px; }
  .rd-form textarea { font-size: 16px; }
  .rd-btn { height: 46px; }
  .rd-card .pw-eye { width: 40px; height: 40px; }
  .rd-row a, .rd-foot a, .rd-below a { display: inline-block; padding: 10px 0; margin: -10px 0; }
  .rd-top { padding: 10px 16px; }
  body.rd-pub .rd-top a.rd-nav { padding: 12px 6px; }
  .rd-top .rd-btn { height: 44px; }
  .rd-contact { padding: 28px 16px; gap: 24px; }
  .rd-intro h1 { font-size: 27px; }
  .rd-contact .rd-card { padding: 20px 16px; }
}

/* mcache.js marks /forgot and /reset as signed-in screens (html.m-app), which draws a loading sidebar; not here */
html.m-app body.rd-auth:not(.with-sb) { padding-left: 16px; }
html.m-app body.rd-auth:not(.with-sb)::before { content: none; display: none; }
