/*
 * Innkeepers SSO — auth screens. A calm, conventional identity UI: one centered
 * card, clean fields, a solid primary action. Chrome stays neutral; brand
 * identity lives in the co-branded lockup (Brand).
 *
 * Theme: `html[data-theme="dark|light"]` (carried from the origin site through
 * the OAuth flow) wins; with no explicit choice the OS's prefers-color-scheme
 * decides. All themeable values are tokens, so the dark palette is one block.
 */

:root {
  --bg: #edf0f3;
  --card: #ffffff;
  --ink: #1f2328;
  --muted: #6b7280;
  --line: #d9dde3;
  --line-strong: #c3c9d1;
  --field-bg: #ffffff;
  --inset: #fbfcfd;
  --accent: #26303f;         /* primary action */
  --accent-hover: #333f52;
  --accent-ink: #ffffff;     /* text on the primary action */
  --link: #2f5bb7;
  --focus: rgba(38, 48, 63, 0.16);
  --radius: 10px;
  --flash-ok-bg: #ecfdf5; --flash-ok-fg: #065f46; --flash-ok-bd: #6ee7b7;
  --flash-bad-bg: #fef2f2; --flash-bad-fg: #991b1b; --flash-bad-bd: #fca5a5;
  --flash-info-bg: #eff6ff; --flash-info-fg: #1e40af; --flash-info-bd: #93c5fd;
}

/* Dark palette — one token block, applied by an explicit choice OR, absent one,
   by the OS preference. (Duplicated selector is the standard cost of doing both
   with pure CSS custom properties.) */
[data-theme="dark"] {
  --bg: #131519;
  --card: #1e2127;
  --ink: #e7e9ec;
  --muted: #9aa1a9;
  --line: #2b303a;
  --line-strong: #3b414c;
  --field-bg: #24272e;
  --inset: #22252c;
  --accent: #e8eaee;
  --accent-hover: #ffffff;
  --accent-ink: #181b21;
  --link: #8fb2ff;
  --focus: rgba(232, 234, 238, 0.22);
  --flash-ok-bg: #0e2a20; --flash-ok-fg: #8ff0c8; --flash-ok-bd: #1c5e46;
  --flash-bad-bg: #2c1416; --flash-bad-fg: #ffb3b3; --flash-bad-bd: #6e2b2f;
  --flash-info-bg: #12213a; --flash-info-fg: #a9c9ff; --flash-info-bd: #2c4a7a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #131519;
    --card: #1e2127;
    --ink: #e7e9ec;
    --muted: #9aa1a9;
    --line: #2b303a;
    --line-strong: #3b414c;
    --field-bg: #24272e;
    --inset: #22252c;
    --accent: #e8eaee;
    --accent-hover: #ffffff;
    --accent-ink: #181b21;
    --link: #8fb2ff;
    --focus: rgba(232, 234, 238, 0.22);
    --flash-ok-bg: #0e2a20; --flash-ok-fg: #8ff0c8; --flash-ok-bd: #1c5e46;
    --flash-bad-bg: #2c1416; --flash-bad-fg: #ffb3b3; --flash-bad-bd: #6e2b2f;
    --flash-info-bg: #12213a; --flash-info-fg: #a9c9ff; --flash-info-bd: #2c4a7a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* The centered card every screen sits in. */
.wrap {
  max-width: 440px;
  margin: 3rem auto;
  padding: 2rem 2rem 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.14);
}
@media (max-width: 480px) {
  .wrap { margin: 1rem; padding: 1.5rem 1.25rem; }
}

h1, h2, h3 { line-height: 1.25; }
.wrap > h1:first-child,
.wrap > h2:first-child { margin-top: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; margin: 0 0 1.25rem; }
h3 { font-size: 1rem; color: var(--muted); text-transform: uppercase;
     letter-spacing: 0.04em; margin: 1.5rem 0 0.5rem; }

/* Fields */
.field { margin: 0 0 1rem; }
.field label,
.field > label { display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--ink); margin-bottom: 0.35rem; }
.field em { color: var(--muted); font-style: normal; font-weight: 400; }

input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input:not([type]), select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}
input[type="checkbox"] { width: auto; margin: 0.2rem 0 0; accent-color: var(--accent); }

/* Primary action — submit inputs + button_to buttons (OmniAuth, admin). */
.actions { margin-top: 1.25rem; }
input[type="submit"], button[type="submit"] {
  display: inline-block;
  width: 100%;
  padding: 0.68rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}
input[type="submit"]:hover, button[type="submit"]:hover { background: var(--accent-hover); }
input[type="submit"]:focus-visible, button[type="submit"]:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--focus);
}
form[class="button_to"] { margin: 0.5rem 0 0; }

/* The remember-me row: checkbox beside its label, not stacked. */
.field:has(> input[type="checkbox"]) {
  display: flex; align-items: center; gap: 0.5rem;
}
.field:has(> input[type="checkbox"]) label { margin: 0; font-weight: 400; }

/* Secondary links under a form (Log in / Sign up / Forgot password …). */
.auth-links {
  margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 0.4rem;
}
.auth-links br { display: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.auth-links a { font-size: 0.9rem; }

/* Dashboard + admin lists */
.wrap ul { padding-left: 1.1rem; margin: 0.5rem 0; }
.wrap li { margin: 0.3rem 0; }

/* ---------- Flash ---------- */
.flash {
  padding: 0.7rem 0.9rem; margin: 0 0 1rem; border-radius: var(--radius);
  border: 1px solid transparent; font-size: 0.9rem;
}
.flash--success { background: var(--flash-ok-bg); color: var(--flash-ok-fg); border-color: var(--flash-ok-bd); }
.flash--problem { background: var(--flash-bad-bg); color: var(--flash-bad-fg); border-color: var(--flash-bad-bd); }
.flash--info    { background: var(--flash-info-bg); color: var(--flash-info-fg); border-color: var(--flash-info-bd); }

/* ---------- Co-branded auth header (Brand) ---------- */
.auth-brand { margin-bottom: 1.5rem; }
.auth-brand__lockup { display: flex; align-items: center; gap: 8px;
  font-size: 1.3rem; letter-spacing: 0.02em; margin-bottom: 0.75rem; }
.auth-brand__lockup .brand-mark { width: 26px; height: 26px; }
.auth-brand__name { font-weight: 600; }
.auth-brand h2 { margin: 0; font-size: 1.3rem; }
.auth-brand__note { color: var(--muted); font-size: 0.85rem; margin: 0.35rem 0 0; }
.brand--duskforge { color: #6d7a6a; }

/* ---------- Sign-up consent ---------- */
.consent {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.85rem 1rem; margin: 1.25rem 0 0; background: var(--inset);
}
.consent__row { display: flex; gap: 0.55rem; align-items: flex-start; margin: 0.5rem 0; }
.consent__row label { font-size: 0.88rem; line-height: 1.4; }
.consent__row--optional {
  border-top: 1px dashed var(--line-strong); padding-top: 0.7rem;
  margin-top: 0.7rem; color: var(--muted);
}

/* ---------- Admin: account typeahead ---------- */
.user-picker { position: relative; }
.user-suggest {
  position: absolute; z-index: 5; min-width: 280px; margin-top: 2px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); overflow: hidden;
}
.user-suggest__row {
  display: block; width: 100%; text-align: left; padding: 6px 10px;
  background: none; border: 0; color: var(--ink); font-size: 0.9rem; cursor: pointer;
}
.user-suggest__row:hover, .user-suggest__row.on { background: var(--inset); }
.user-suggest__hint { padding: 6px 10px; font-size: 0.9rem; color: var(--muted); }
