/* PipRank register / login pages (register.html, login.html): centred logo, bold two-line title, floating
   die + checker illustration, one big green email button, OR divider, dark provider buttons, guest link.
   PipRank palette only: every value is a Theme token from Assets/BackgammonApp.Style.cs (BgBase, BgRaised,
   Surface, Surface2, Hairline, NavBg, Primary, PrimaryHighlight, PrimaryLip). Dark only. */
:root {
  --a-bg: #26292D;          /* Theme.BgBase */
  --a-raised: #1D2127;      /* input well: one step below Theme.BgRaised, >=10 units from every excluded value */
  --a-surface: #30343A;     /* Theme.Surface */
  --a-surface2: #3A3F46;    /* Theme.Surface2 */
  --a-hairline: #474D55;    /* Theme.Hairline */
  --a-text: #FFFFFF;
  --a-text2: #CDCBC8;
  --a-text3: #B2AFAB;
  --a-primary: #3FA56A;     /* Theme.Primary */
  --a-primary-hi: #5CB882;  /* Theme.PrimaryHighlight */
  --a-primary-lip: #2B7A4C; /* Theme.PrimaryLip */
  --a-nav: #1B1E21;         /* Theme.NavBg */
  --a-danger: #F5776A;
  --a-sans: Inter, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--a-bg); }
body.auth {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--a-bg);
  color: var(--a-text);
  font-family: var(--a-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }

/* Header: logo centred, the switch link (Log In / Sign Up) top-right. */
.auth-top {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px 24px 0;
  height: 76px;
}
.auth-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--a-text); }
.auth-logo svg { width: 38px; height: 38px; display: block; }
.auth-logo span { font-weight: 800; font-size: 30px; letter-spacing: -0.02em; line-height: 1; }
.auth-switch {
  position: absolute;
  right: 40px;
  top: 25px;
  font-size: 14px;
  font-weight: 700;
  color: var(--a-text2);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--a-hairline);
  border-radius: 10px;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.auth-switch:hover, .auth-switch:focus-visible { color: var(--a-text); border-color: var(--a-primary); background: rgba(63, 165, 106, .10); }

/* Brand mark classes (same geometry and colours as the loader mark in index.html). */
.m-edge { fill: var(--a-primary-lip); }
.m-face { fill: var(--a-primary); }
.m-bevel { fill: var(--a-primary-hi); }
.m-shadow { fill: rgba(4, 10, 24, .45); }
.m-die-edge { fill: #A2A298; }
.m-die-face { fill: #FFFFFF; }
.m-pip { fill: var(--a-bg); }
.m-rim { fill: #EDEDE7; }
.m-ck-bevel { fill: #0E151A; } /* cool-shifted from #101511 so its anti-aliased rim never lands near an excluded warm charcoal */
.m-ck-edge { fill: #1D2E27; }
.m-ck-face { fill: #3B4A40; }
.m-ck-groove { fill: none; stroke: rgba(11, 16, 13, .50); stroke-width: .83; }
.m-ck-spec { fill: none; stroke: rgba(220, 232, 223, .32); stroke-width: 1.32; stroke-linecap: round; }

/* Centre column. */
.auth-main { width: 100%; max-width: 468px; margin: 0 auto; padding: 0 24px 48px; text-align: center; }
.auth-title {
  margin: 12px auto 0;
  font-size: 34px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
/* Desktop: the title is one line and may run past the 420px button column (it stays centred on the same axis). */
@media (min-width: 601px) {
  .auth-title { margin-left: -80px; margin-right: -80px; }
}
.auth-art { display: flex; justify-content: center; margin: 40px auto 34px; height: 169px; }
.auth-art img { width: 300px; height: 169px; display: block; }
body.auth-expanded .auth-art { height: 0; margin: 24px auto 0; overflow: hidden; visibility: hidden; }

/* Buttons. */
.btn {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  color: var(--a-text);
  cursor: pointer;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  transition: filter .12s ease, transform .08s ease, box-shadow .08s ease;
}
.btn:focus-visible { outline: 2px solid var(--a-text); outline-offset: 3px; }
.btn[disabled] { cursor: default; filter: saturate(.6) brightness(.85); }
.btn-primary {
  height: 60px;
  font-size: 21px;
  background: linear-gradient(180deg, var(--a-primary-hi) 0%, var(--a-primary) 62%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 2px 0 0 var(--a-primary-lip), 0 6px 14px rgba(4, 10, 24, .35);
  text-shadow: 0 1px 1px rgba(4, 10, 24, .22);
  margin-bottom: 2px;
}
.btn-primary:hover:not([disabled]) { filter: brightness(1.07); }
.btn-primary:active:not([disabled]) { transform: translateY(1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 1px 0 0 var(--a-primary-lip), 0 3px 8px rgba(4, 10, 24, .30); }
.btn-social {
  height: 52px;
  font-size: 17px;
  font-weight: 700;
  background: var(--a-surface);
  border: 1px solid var(--a-hairline);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  margin-bottom: 10px;
  transition: background-color .15s ease, border-color .15s ease, transform .08s ease;
}
.btn-social:hover:not([disabled]) { background: var(--a-surface2); border-color: #59606A; }
.btn-social:active:not([disabled]) { transform: translateY(1px); }
.btn-social svg { width: 24px; height: 24px; flex: 0 0 auto; }
.btn .spin {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: a-spin .8s linear infinite;
}
@keyframes a-spin { to { transform: rotate(360deg); } }

/* OR divider. */
.auth-or {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0;
  color: var(--a-text3);
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--a-hairline); }

/* Email form. */
.auth-form { text-align: left; }
.auth-form[hidden] { display: none; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--a-text2); margin: 0 0 6px 2px; }
.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--a-hairline);
  background: var(--a-raised);
  color: var(--a-text);
  font: 600 16px/1 var(--a-sans);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.field input::placeholder { color: #878D95; font-weight: 500; }
.field input:focus { border-color: var(--a-primary); box-shadow: 0 0 0 3px rgba(63, 165, 106, .28); }
.field input[aria-invalid="true"] { border-color: var(--a-danger); }
.field .hint { font-size: 12px; color: var(--a-text3); margin: 6px 0 0 2px; }
.field-pw { position: relative; }
.field-pw input { padding-right: 64px; }
.pw-toggle {
  position: absolute; right: 6px; bottom: 8px; height: 36px; padding: 0 10px;
  background: none; border: 0; color: var(--a-text3); font: 700 13px var(--a-sans); cursor: pointer; border-radius: 6px;
}
.pw-toggle:hover, .pw-toggle:focus-visible { color: var(--a-text); }
.auth-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 119, 106, .12);
  border: 1px solid rgba(245, 119, 106, .45);
  color: var(--a-danger);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
}
.auth-error[hidden] { display: none; }
.auth-error.ok { color: var(--a-primary-hi); background: rgba(63, 165, 106, .12); border-color: rgba(63, 165, 106, .45); }
/* Neutral notice (account linking: which sign-in to use once). Existing tokens only. */
.auth-error.info { color: var(--a-text); background: var(--a-surface); border-color: var(--a-hairline); }
.auth-row { display: flex; justify-content: flex-end; align-items: center; margin: -4px 0 16px; }
.auth-link { color: var(--a-text2); font-weight: 700; text-decoration: none; background: none; border: 0; padding: 0; font-family: inherit; font-size: 13px; cursor: pointer; }
.auth-link:hover, .auth-link:focus-visible { color: var(--a-text); text-decoration: underline; }
.auth-back { display: block; margin: 14px auto 0; }

.auth-legal { margin: 36px auto 0; max-width: 420px; color: var(--a-text3); font-size: 13px; line-height: 1.5; text-wrap: balance; }
.auth-legal a { color: var(--a-text2); }
.auth-guest { display: inline-block; margin: 10px auto 0; padding: 6px 8px; color: var(--a-text2); font-size: 15px; font-weight: 700; text-decoration: none; }
.auth-guest:hover, .auth-guest:focus-visible { color: var(--a-text); text-decoration: underline; }
.auth-alt { margin-top: 22px; color: var(--a-text3); font-size: 14px; }
.auth-alt a { color: var(--a-text); font-weight: 700; text-decoration: none; }
.auth-alt a:hover { text-decoration: underline; }

/* Toast (honest "coming soon" notices and network notes). */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--a-nav);
  border: 1px solid var(--a-hairline);
  box-shadow: 0 10px 30px rgba(4, 10, 24, .45);
  color: var(--a-text);
  font-size: 15px; font-weight: 600; line-height: 1.35; text-align: center;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.auth-form.reveal { animation: a-reveal .22s ease-out; }
@keyframes a-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Phones (430 wide). */
@media (max-width: 600px) {
  .auth-top { height: 64px; padding: 14px 16px 0; }
  .auth-logo svg { width: 30px; height: 30px; }
  .auth-logo span { font-size: 25px; }
  .auth-switch { right: 16px; top: 17px; font-weight: 600; padding: 7px 12px; }
  .auth-main { padding: 0 16px 40px; }
  .auth-title { font-size: 30px; margin-top: 10px; }
  .auth-art { margin: 46px auto 36px; height: 158px; }
  .auth-art img { width: 280px; height: 158px; }
  .btn-primary { height: 52px; font-size: 18px; }
  .btn-social { height: 48px; font-size: 16px; margin-bottom: 8px; }
  .btn-social svg { width: 20px; height: 20px; }
  .auth-or { margin: 20px 0; }
  .auth-legal { font-size: 12px; margin-top: 44px; }
}
@media (max-width: 360px) {
  .auth-switch { right: 10px; }
  .auth-title { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .btn-social, .toast, .field input, .auth-switch { transition: none; }
  .auth-form.reveal { animation: none; }
  .btn .spin { animation-duration: 2.4s; }
}

/* Login: the illustration is the SAME size as on register (300x169 desktop, 280x158 phone) so both pages read as one
   family. The SVG box has ~43px of empty sky at the top, so a small top margin still clears the title; 22px below plus
   the box's own ~6px bottom air keeps the drawn board >=24px above the Email label. The Log In button still ends above
   600px at 1440x900 and the whole page fits 1440x900 and 430x932 without a scrollbar (a scrollbar would shift the
   centred column off the register page's axis). */
.auth-art.sm { margin: 4px auto 22px; height: 169px; }
.auth-art.sm img { width: 300px; height: 169px; }
body[data-auth="login"] .auth-or { margin: 20px 0; }
body[data-auth="login"] .btn-social { margin-bottom: 10px; }
body[data-auth="login"] .auth-alt { margin-top: 14px; }
body[data-auth="login"] .auth-main { padding-bottom: 24px; }
@media (max-width: 600px) {
  .auth-art.sm { margin: 4px auto 20px; height: 158px; }
  .auth-art.sm img { width: 280px; height: 158px; }
  body[data-auth="login"] .btn-social { margin-bottom: 8px; }
}
