/* WideBear · shared auth-pages (login, register, password reset) */

/* Body-level rules are scoped to the auth-pages body class only — so pages
   that only reuse auth.css form/alert/logo classes (UI-kit design-system)
   don't inherit a `height: 100%` and therefore keep document scrolling.
   The auth layout itself uses `min-height: 100vh` on .wb-login, so it
   doesn't need html/body to be 100% tall. */
body.wb-login-body {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}

/* Ensure `hidden` attribute wins over explicit display rules */
.wb-login [hidden] { display: none !important; }

/* ---------- Layout ---------- */
.wb-login {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 1.1fr;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.wb-login__pane {
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

.wb-login__brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}
.wb-login__brand:hover { color: var(--text); }

.wb-login__form-wrap {
  max-width: 420px;
  width: 100%;
  margin: auto;
}

.wb-login__eyebrow {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wb-login__title {
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin: 10px 0 8px;
}

.wb-login__title-accent { color: var(--amber); }

.wb-login__lede {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 22px;
  line-height: 1.5;
}

/* ---------- Form ---------- */
.wb-login__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wb-login__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wb-login__label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.wb-login__input {
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14.5px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  width: 100%;
}
.wb-login__input:hover { border-color: var(--border-strong); }
.wb-login__input:focus {
  border-color: var(--amber);
  background: var(--surface);
  box-shadow: var(--ring);
}
.wb-login__input.is-invalid { border-color: var(--coral); }

.wb-login__input-wrap {
  position: relative;
  display: block;
}
.wb-login__input--with-toggle {
  padding-right: 44px;
}
.wb-login__pwd-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.wb-login__pwd-toggle:hover { color: var(--text); background: var(--surface-3, rgba(0,0,0,0.04)); }
.wb-login__pwd-toggle:focus-visible {
  outline: none;
  color: var(--text);
  box-shadow: var(--ring);
}
.wb-login__pwd-icon { display: block; }

.wb-login__input--center {
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: var(--font-mono);
}

.wb-login__field-error {
  font-size: 12.5px;
  color: var(--coral);
}

.wb-login__form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}

.wb-login__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.wb-login__remember input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.wb-login__remember input:checked {
  background: var(--amber);
  border-color: var(--amber);
}
.wb-login__remember input:checked::after {
  content: "";
  position: absolute;
  left: 4px; top: 0.5px;
  width: 5px; height: 9px;
  border-right: 2px solid var(--amber-ink);
  border-bottom: 2px solid var(--amber-ink);
  transform: rotate(45deg);
}

.wb-login__link {
  color: var(--amber);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.wb-login__link:hover { text-decoration: underline; }

.wb-login__submit {
  height: 48px;
  border-radius: 12px;
  border: none;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 4px;
  transition: transform 0.15s ease, opacity 0.15s ease;
  font-family: inherit;
  width: 100%;
}
.wb-login__submit:hover { opacity: 0.9; }
.wb-login__submit:active { transform: translateY(1px); }
.wb-login__submit:disabled { opacity: 0.5; cursor: not-allowed; }

.wb-login__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 24px;
}
.wb-login__back:hover { color: var(--text); }

.wb-login__register {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.wb-login__foot {
  font-size: 12px;
  color: var(--text-soft);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.wb-login__foot a { color: inherit; text-decoration: none; }
.wb-login__foot a:hover { color: var(--text-muted); }

/* ---------- Alerts ---------- */
.wb-login__alerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.wb-login__alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.4;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.wb-login__alert--danger {
  background: var(--coral-soft);
  color: var(--on-coral-soft);
  border: 1px solid color-mix(in oklab, var(--coral) 25%, transparent);
}
.wb-login__alert--info {
  background: var(--electric-soft);
  color: var(--on-electric-soft);
}
.wb-login__alert--hint {
  background: var(--amber-soft);
  color: var(--on-amber-soft);
  border: 1px solid color-mix(in oklab, var(--amber) 25%, transparent);
}
.wb-login__alert-timer { font-family: var(--font-mono); font-weight: 700; }

.wb-login__honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Method buttons (reset pw) ---------- */
.wb-login__methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wb-login__method {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: auto;
  min-height: 64px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  text-align: left;
}
.wb-login__method:hover:not(:disabled) {
  border-color: var(--amber);
  background: var(--surface-2);
}
.wb-login__method:active:not(:disabled) { transform: translateY(1px); }
.wb-login__method:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.wb-login__method-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.wb-login__method-body { flex: 1; min-width: 0; }
.wb-login__method-title {
  font-size: 14.5px;
  font-weight: 700;
  margin-bottom: 2px;
}
.wb-login__method-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}
.wb-login__method-sub--danger { color: var(--coral); }

/* ---------- Success/info icon ---------- */
.wb-login__icon-big {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.wb-login__icon-big--mint {
  background: var(--mint-soft);
  color: var(--mint);
}
.wb-login__icon-big--coral {
  background: var(--coral-soft);
  color: var(--coral);
}

/* ---------- Right cinematic stage ---------- */
.wb-login__stage {
  position: relative;
  overflow: hidden;
  background: #0a0a0a;
  color: #F7F5F0;
  cursor: none;
}
.wb-login__stage svg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.wb-login__chrome {
  position: absolute;
  left: 40px;
  right: 40px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.38);
  letter-spacing: 0.18em;
  pointer-events: none;
}
.wb-login__chrome--top {
  top: 40px;
  display: flex;
  justify-content: space-between;
}
.wb-login__chrome--bottom {
  bottom: 40px;
  display: flex;
  justify-content: space-between;
}

@keyframes wb-live-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
.wb-login__live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: #f5a524;
  margin-right: 8px;
  vertical-align: middle;
  animation: wb-live-blink 1.6s ease-in-out infinite;
}

/* ---------- Logo ---------- */
.wb-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.wb-logo__mark {
  overflow: visible;
  flex: none;
}
.wb-logo__word {
  font-family: var(--font-ui);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}
.wb-logo__word-accent { color: var(--amber); }

@keyframes wb-ring {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(1.08); }
}
@keyframes wb-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  94%, 98%      { transform: scaleY(0.08); }
}
@keyframes wb-rec {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.15; }
}
@keyframes wb-ear-wiggle {
  0%, 70%, 100% { transform: translate(0, 0) rotate(0); }
  78%           { transform: translate(0, -1px) rotate(-3deg); }
  86%           { transform: translate(0, 0) rotate(2deg); }
}
.wb-logo__mark .wb-logo__ring {
  transform-origin: 32px 32px;
  animation: wb-ring 4.5s ease-in-out infinite;
}
.wb-logo__mark .wb-logo__eye-l {
  transform-origin: 24.5px 30px;
  animation: wb-blink 6s ease-in-out infinite;
}
.wb-logo__mark .wb-logo__eye-r {
  transform-origin: 39.5px 30px;
  animation: wb-blink 6s ease-in-out infinite;
}
.wb-logo__mark .wb-logo__rec {
  animation: wb-rec 1.6s ease-in-out infinite;
}
.wb-logo__mark .wb-logo__ear-l {
  transform-origin: 16px 18px;
  animation: wb-ear-wiggle 7s ease-in-out infinite;
}
.wb-logo__mark .wb-logo__ear-r {
  transform-origin: 48px 18px;
  animation: wb-ear-wiggle 7s ease-in-out 0.4s infinite;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .wb-login { grid-template-columns: 1fr; min-height: 100vh; }
  .wb-login__stage { display: none; }
  .wb-login__pane { padding: 32px 24px; min-height: 100vh; }
}

@media (max-width: 520px) {
  .wb-login__pane { padding: 24px 18px; }
  .wb-login__title { font-size: 28px; }
  .wb-login__foot {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .wb-logo__mark .wb-logo__ring,
  .wb-logo__mark .wb-logo__eye-l,
  .wb-logo__mark .wb-logo__eye-r,
  .wb-logo__mark .wb-logo__rec,
  .wb-logo__mark .wb-logo__ear-l,
  .wb-logo__mark .wb-logo__ear-r,
  .wb-login__live-dot {
    animation: none !important;
  }
}
