/* signin.html: one dark screen for new and returning dealers.
   Tokens come from brand.css; the ground is --rz-ink, the one accent is oxblood.
   Wide: the building still on the left, the panel on the right.
   Narrow: the still fills the top and fades into the panel. */

.signin-page { background: var(--rz-ink); color: var(--rz-paper); min-height: 100vh; min-height: 100dvh; }

.signin { position: relative; display: grid; grid-template-rows: auto 1fr; min-height: 100vh; min-height: 100dvh; background: var(--rz-ink); }
.signin__art { position: relative; inset: auto; max-height: 42vh; margin: 0; overflow: hidden; }
.signin__art img { width: 100%; height: auto; max-height: 42vh; object-fit: cover; object-position: 50% 30%; display: block; }
.signin__art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,15,15,0) 0%, rgba(15,15,15,.45) 55%, var(--rz-ink) 98%);
}

.signin__panel {
  position: relative; z-index: 1; align-self: end;
  width: 100%; max-width: 440px; margin-inline: auto; margin-top: -48px;
  background: linear-gradient(180deg, transparent, var(--rz-ink) 48px);
  padding: calc(48px + var(--rz-space-sm)) var(--gut) var(--rz-space-md);
  display: flex; flex-direction: column; gap: var(--rz-space-sm);
}
.signin__logo { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: var(--rz-space-sm); }
.signin__logo img { height: 30px; width: auto; display: block; }

.signin__step { display: flex; flex-direction: column; gap: var(--rz-space-sm); }
.signin__step[hidden], .signin__form[hidden] { display: none; }

/* Buttons */
.sbtn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; min-height: 52px; padding: 12px 20px;
  font-family: var(--rz-font-text); font-size: 17px; font-weight: 500; line-height: 1.2;
  border-radius: var(--rz-radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: background-color var(--flip), color var(--flip), border-color var(--flip);
}
.sbtn--light { background: var(--rz-paper); color: var(--rz-ink); }
.sbtn--light:hover { background: var(--rz-aluminium-light); }
.sbtn--line { background: transparent; color: var(--rz-paper); border-color: rgba(255,255,255,.55); }
.sbtn--line:hover { border-color: var(--rz-paper); background: rgba(255,255,255,.08); }
.sbtn--primary { background: var(--rz-oxblood); color: #fff; border-color: var(--rz-oxblood); }
.sbtn--primary:hover { background: #fff; color: var(--rz-ink); border-color: #fff; }
.sbtn[aria-disabled="true"] { opacity: .55; cursor: progress; }
.sbtn__icon { flex: none; }
.sbtn:focus-visible, .signin__link:focus-visible, .signin input:focus-visible, .signin__legal a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.lastused {
  flex: none; margin-left: 4px;
  font-family: var(--rz-font-data); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: var(--rz-radius-chip);
  background: var(--rz-oxblood); color: #fff;
}
.lastused[hidden] { display: none; }
@media (max-width: 380px) { .lastused { display: none !important; } .sbtn { padding-inline: 12px; } }
.sbtn:has(.lastused:not([hidden])) { padding-inline: 14px; gap: 10px; }

/* Google's own rendered button sits transparently over ours, so the click lands
   in Google's frame (the only way to receive an ID token) while the look stays ours. */
.signin__google { position: relative; }
.signin__gslot { position: absolute; inset: 0; overflow: hidden; opacity: .01; display: flex; justify-content: center; align-items: center; }
.signin__gslot > div, .signin__gslot iframe { width: 100% !important; }
.signin__google:focus-within .sbtn--light { outline: 2px solid #fff; outline-offset: 3px; }
.signin__gslot:empty { display: none; }

/* A call in flight: the button is disabled and spins (the server answers slowly on purpose). */
.sbtn.is-busy { cursor: progress; }
.sbtn.is-busy::after {
  content: ""; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: signin-spin .8s linear infinite;
}
@keyframes signin-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sbtn.is-busy::after { animation: none; border-right-color: currentColor; } }

/* The one consent box on the profile step */
.signin__check { display: flex; align-items: flex-start; gap: 12px; margin-top: 4px; }
.signin .signin__check input[type=checkbox] { flex: none; width: 24px; height: 24px; min-height: 0; padding: 0; margin: 10px 0 0; background: none; accent-color: var(--rz-oxblood); }
.signin .signin__check label:not(.sr-only) {
  margin: 0; min-height: 44px; display: block; flex: 1; padding-block: 10px; line-height: 1.45;
  font-family: var(--rz-font-text); font-size: 16px; font-weight: 400; letter-spacing: 0; text-transform: none; color: rgba(255,255,255,.9);
}

/* Fields */
.signin label:not(.sr-only) {
  font-family: var(--rz-font-data); font-size: var(--rz-size-label); font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.78); margin-top: 4px;
}
.signin input {
  width: 100%; min-height: 52px; padding: 12px 14px;
  font: inherit; font-size: 17px; color: var(--rz-paper);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.55); border-radius: var(--rz-radius-sm);
}
.signin select {
  width: 100%; min-height: 52px; padding: 12px 14px;
  font: inherit; font-size: 17px; color: var(--rz-paper);
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.55); border-radius: var(--rz-radius-sm);
}
.signin select option, .signin select optgroup { color: #111; background: #fff; }
.signin select:focus { border-color: #fff; }
.signin select:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.signin select[aria-invalid="true"] { border-color: #fff; border-width: 2px; padding: 11px 13px; }
.signin__hint { margin: 4px 0 0; max-width: none; font-size: 16px; line-height: 1.45; color: rgba(255,255,255,.86); }
.signin__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.signin__pair > div { display: flex; flex-direction: column; gap: 8px; }
.signin input::placeholder { color: rgba(255,255,255,.62); }
.signin input:focus { border-color: #fff; }
.signin input[aria-invalid="true"] { border-color: #fff; border-width: 2px; padding: 11px 13px; }
.signin__check a { color: #fff; text-decoration: underline; text-underline-offset: .18em; display: inline-block; min-height: 24px; line-height: 24px; }
.signin__check a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.signin .signin__check input[type=checkbox]:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
#code, #pCode { font-family: var(--rz-font-data); font-size: 22px; letter-spacing: .4em; text-align: center; }
#code::placeholder, #pCode::placeholder { font-family: var(--rz-font-text); font-size: 17px; letter-spacing: 0; }

.signin__lead { margin: 0; max-width: none; color: rgba(255,255,255,.86); overflow-wrap: anywhere; }
.signin__lead b { color: var(--rz-paper); font-weight: 500; }
.signin__ts:empty { display: none; }
.signin__link {
  min-height: 44px; background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 16px; color: rgba(255,255,255,.86); text-decoration: underline; text-underline-offset: .18em;
  text-decoration-color: rgba(255,255,255,.5); text-align: center;
}
.signin__link:hover { color: #fff; text-decoration-color: var(--rz-oxblood); }

.signin__msg { margin: 0; max-width: none; min-height: 0; font-size: 16px; color: #fff; }
.signin__msg:not(:empty) { padding: 10px 14px; border-radius: var(--rz-radius-sm); border: 1px solid var(--rz-oxblood); background: rgba(150,25,28,.35); }

.signin__legal { display: flex; justify-content: center; gap: var(--rz-space-md); margin: var(--rz-space-sm) 0 0; max-width: none; }
.signin__legal a { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; font-size: 15px; color: rgba(255,255,255,.78); text-decoration-color: rgba(255,255,255,.4); }
.signin__legal a:hover { color: #fff; }

@media (min-width: 720px) {
  .signin { grid-template-columns: minmax(0, 1fr) minmax(400px, 480px); grid-template-rows: auto; }
  .signin__art { position: absolute; inset: 0; max-height: none; }
  .signin__art img { height: 100%; max-height: none; }
  .signin__art::after { background: linear-gradient(90deg, rgba(15,15,15,0) 50%, rgba(15,15,15,.8) 66%, var(--rz-ink) 76%); }
  .signin__panel { grid-column: 2; align-self: center; max-width: none; margin: 0; background: none; padding: var(--rz-space-xl) clamp(32px, 4vw, 56px); }
}
@media (prefers-reduced-motion: reduce) { .sbtn { transition: none; } }
