/* ============================================================
 * OzBook · auth.css
 *
 * Styles for authentication flows (Login, Register, ForgotPassword, ...).
 * Used together with _LoginLayout.cshtml.
 *
 * Visuals follow the design system's identity/login design — dark
 * Eucalyptus + Outback Gold scene with drifting blobs, flipping books,
 * boomerang swooshes, a starfield, and a centred glass card.
 * ============================================================ */

.ob-auth-body {
  font-family: var(--ob-font-sans);
  color: var(--ob-fg-1);
  overflow: hidden;
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ===== Background ===== */
.ob-auth-bg {
  position: fixed; inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at top left,  #1A6B3C 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, #0D2318 0%, transparent 60%),
    linear-gradient(160deg, #0F2A1A 0%, #061E11 100%);
}
.ob-auth-bg::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 16px, rgba(255,255,255,0.025) 16px 17px);
  pointer-events: none;
}

.ob-auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: ob-auth-drift 22s ease-in-out infinite;
  will-change: transform;
  pointer-events: none;
}
.ob-auth-blob.b1 { width: 520px; height: 520px; background: #1A6B3C; top: -120px; left: -120px; animation-duration: 26s; }
.ob-auth-blob.b2 { width: 460px; height: 460px; background: #F0A020; bottom: -140px; right: -100px; animation-duration: 30s; animation-delay: -8s; opacity: 0.4; }
.ob-auth-blob.b3 { width: 380px; height: 380px; background: #2F8757; top: 30%; right: 18%; animation-duration: 34s; animation-delay: -4s; }
.ob-auth-blob.b4 { width: 320px; height: 320px; background: #5DA67F; bottom: 18%; left: 22%; animation-duration: 28s; animation-delay: -14s; opacity: 0.35; }
@keyframes ob-auth-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  25%      { transform: translate3d(60px, -40px, 0) scale(1.08); }
  50%      { transform: translate3d(-30px, 50px, 0) scale(0.95); }
  75%      { transform: translate3d(-50px, -20px, 0) scale(1.05); }
}

.ob-auth-swoosh {
  position: absolute;
  width: 380px; height: 80px;
  opacity: 0.08;
  animation: ob-auth-swoosh-fly 18s linear infinite;
  pointer-events: none;
}
.ob-auth-swoosh path {
  fill: none; stroke: #F0A020; stroke-width: 8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ob-auth-swoosh.s1 { top: 14%; animation-delay: -2s; }
.ob-auth-swoosh.s2 { top: 58%; animation-duration: 24s; animation-delay: -10s; opacity: 0.06; }
.ob-auth-swoosh.s3 { top: 82%; animation-duration: 20s; animation-delay: -6s; opacity: 0.05; }
@keyframes ob-auth-swoosh-fly {
  0%   { transform: translateX(-420px) rotate(-6deg); }
  100% { transform: translateX(calc(100vw + 100px)) rotate(-6deg); }
}

.ob-auth-stars { position: absolute; inset: 0; pointer-events: none; }
.ob-auth-stars span {
  position: absolute; width: 2px; height: 2px;
  background: #FAFAF7; border-radius: 50%;
  opacity: 0.25;
  animation: ob-auth-twinkle 4s ease-in-out infinite;
}
@keyframes ob-auth-twinkle { 0%,100% { opacity: 0.15; } 50% { opacity: 0.6; } }

/* ===== Flipping books ===== */
.ob-auth-book {
  position: absolute;
  width: 140px; height: 100px;
  perspective: 900px;
  opacity: 0.18;
  pointer-events: none;
}
.ob-auth-book .pages { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.ob-auth-book .cover-left, .ob-auth-book .cover-right {
  position: absolute; top: 0;
  width: 50%; height: 100%;
  background: linear-gradient(135deg, #1A6B3C 0%, #104427 100%);
  border: 2px solid #061E11;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.ob-auth-book .cover-left  { left: 0;  border-radius: 4px 0 0 4px; border-right: 0; }
.ob-auth-book .cover-right { left: 50%; border-radius: 0 4px 4px 0; border-left: 0; }
.ob-auth-book .spine {
  position: absolute; top: 0; left: calc(50% - 2px);
  width: 4px; height: 100%;
  background: #0D2318;
  border-radius: 1px;
  z-index: 10;
}
.ob-auth-book .page {
  position: absolute;
  top: 4px; bottom: 4px;
  left: 50%;
  width: calc(50% - 4px);
  background: linear-gradient(90deg, #F7D285 0%, #FBE7BE 50%, #F4BE52 100%);
  border: 1px solid #B26E00;
  border-radius: 0 3px 3px 0;
  transform-origin: 0% 50%;
  backface-visibility: visible;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.ob-auth-book .page::before {
  content: ""; position: absolute;
  inset: 6px 8px 6px 6px;
  background: repeating-linear-gradient(0deg, transparent 0 4px, rgba(13,35,24,0.25) 4px 5px);
  opacity: 0.7;
}
.ob-auth-book .page.p1 { animation: ob-auth-page-flip 5s linear infinite;       }
.ob-auth-book .page.p2 { animation: ob-auth-page-flip 5s linear infinite -1.25s; }
.ob-auth-book .page.p3 { animation: ob-auth-page-flip 5s linear infinite -2.5s;  }
.ob-auth-book .page.p4 { animation: ob-auth-page-flip 5s linear infinite -3.75s; }
@keyframes ob-auth-page-flip {
  0%   { transform: rotateY(0deg);    }
  40%  { transform: rotateY(-175deg); }
  55%  { transform: rotateY(-175deg); }
  95%, 100% { transform: rotateY(0deg);    }
}
.ob-auth-book.k1 { top: 8%;     left: 6%;   animation: ob-auth-book-bob 11s ease-in-out infinite; }
.ob-auth-book.k2 { top: 18%;    right: 8%;  animation: ob-auth-book-bob-2 13s ease-in-out infinite -3s; opacity: 0.14; }
.ob-auth-book.k3 { bottom: 12%; left: 12%;  animation: ob-auth-book-bob-3 15s ease-in-out infinite -7s; opacity: 0.15; }
.ob-auth-book.k4 { bottom: 18%; right: 5%;  animation: ob-auth-book-bob-4 12s ease-in-out infinite -5s; opacity: 0.2;  }
.ob-auth-book.k5 { top: 50%;    left: 38%;  animation: ob-auth-book-bob-5 14s ease-in-out infinite -9s; opacity: 0.08; }
@keyframes ob-auth-book-bob   { 0%,100% { transform: translateY(0) rotate(-4deg); }              50% { transform: translateY(-24px) rotate(4deg); } }
@keyframes ob-auth-book-bob-2 { 0%,100% { transform: translateY(0) rotate(3deg) scale(0.85); }   50% { transform: translateY(-18px) rotate(-3deg) scale(0.85); } }
@keyframes ob-auth-book-bob-3 { 0%,100% { transform: translateY(0) rotate(-5deg) scale(1.05); }  50% { transform: translateY(-26px) rotate(5deg) scale(1.05); } }
@keyframes ob-auth-book-bob-4 { 0%,100% { transform: translateY(0) rotate(4deg); }               50% { transform: translateY(-20px) rotate(-4deg); } }
@keyframes ob-auth-book-bob-5 { 0%,100% { transform: translateY(0) rotate(-6deg) scale(0.7); }   50% { transform: translateY(-16px) rotate(6deg) scale(0.7); } }

/* ===== Dollar mouse trail ===== */
.ob-auth-dollar {
  position: fixed;
  pointer-events: none;
  z-index: 5;
  font-family: var(--ob-font-sans);
  font-weight: 800;
  color: #F0A020;
  text-shadow:
    0 0 10px rgba(240, 160, 32, 0.75),
    0 0 18px rgba(240, 160, 32, 0.4),
    0 1px 0 rgba(13,35,24,0.4);
  will-change: transform, opacity;
  animation: ob-auth-dollar-fade 750ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  user-select: none;
}
@keyframes ob-auth-dollar-fade {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(var(--r, 0deg)); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1)   rotate(var(--r, 0deg)); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 40px)) scale(0.85) rotate(var(--r, 0deg)); }
}

/* ===== Main + card ===== */
.ob-auth-main {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}
.ob-auth-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 20px;
  box-shadow:
    0 24px 60px rgba(0,0,0,0.32),
    0 8px 16px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.6);
  padding: 32px 32px 28px;
  position: relative;
  z-index: 1;
  animation: ob-auth-card-in 480ms cubic-bezier(0.2, 0.7, 0.2, 1);
  color: var(--ob-fg-1);
}
@keyframes ob-auth-card-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 480px) {
  .ob-auth-card { padding: 24px 22px 22px; border-radius: 16px; }
}

.ob-auth-brand { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-bottom: 22px; }
.ob-auth-brand img { height: 88px; max-width: 100%; }
.ob-auth-brand .welcome { font-size: 13px; color: var(--ob-fg-2); letter-spacing: 0.02em; }
@media (max-width: 480px) {
  .ob-auth-brand img { height: 64px; }
}

/* Validation summary that ASP.NET emits */
.ob-auth-card .text-danger { color: var(--ob-danger); font-size: 12px; }
.ob-auth-card .validation-summary-errors { color: var(--ob-danger); font-size: 13px; margin-bottom: 14px; }
.ob-auth-card .validation-summary-errors ul { padding-left: 18px; margin: 4px 0 0; }

/* Fields */
.ob-auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ob-auth-field > label, .ob-auth-field .form-label {
  font-size: 11px; font-weight: 600; color: var(--ob-fg-2);
  letter-spacing: 0.02em;
  margin: 0;
}
.ob-auth-input-wrap { position: relative; }
.ob-auth-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--ob-border-input);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--ob-fg-1);
  font: 14px var(--ob-font-sans);
  transition: border-color 120ms, box-shadow 120ms;
}
.ob-auth-input::placeholder { color: var(--ob-fg-muted); }
.ob-auth-input:focus {
  outline: 0;
  border-color: var(--ob-primary);
  box-shadow: 0 0 0 3px rgba(26,107,60,0.18);
}
.ob-auth-input.is-invalid, .ob-auth-input.input-validation-error {
  border-color: var(--ob-danger);
}
.ob-auth-input.is-invalid:focus, .ob-auth-input.input-validation-error:focus {
  box-shadow: 0 0 0 3px rgba(181,61,31,0.2);
}
.ob-auth-input-wrap > i.lead {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ob-fg-3); font-size: 16px;
}
.ob-auth-input-wrap > button.trail {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; padding: 8px; border-radius: 6px;
  color: var(--ob-fg-3); cursor: pointer; line-height: 1;
  transition: background 120ms;
}
.ob-auth-input-wrap > button.trail:hover { background: var(--ob-surface-2); color: var(--ob-fg-1); }

.ob-auth-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 18px; gap: 8px; }

/* Custom check */
.ob-auth-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ob-fg-2);
  cursor: pointer; user-select: none;
  margin: 0;
}
.ob-auth-check input { position: absolute; opacity: 0; pointer-events: none; }
.ob-auth-check .box {
  width: 16px; height: 16px;
  border: 1.5px solid var(--ob-border-input);
  border-radius: 4px;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 120ms;
}
.ob-auth-check .box::after {
  content: ""; width: 9px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px); opacity: 0;
  transition: opacity 120ms;
}
.ob-auth-check input:checked + .box {
  background: var(--ob-primary); border-color: var(--ob-primary);
}
.ob-auth-check input:checked + .box::after { opacity: 1; }
.ob-auth-check input:focus-visible + .box { box-shadow: 0 0 0 3px rgba(26,107,60,0.25); }

.ob-auth-link {
  font-size: 12px; font-weight: 600;
  color: var(--ob-fg-link); text-decoration: none;
  transition: color 120ms;
}
.ob-auth-link:hover { color: var(--ob-fg-link-hover); text-decoration: underline; }

/* Buttons */
.ob-auth-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  font: 600 14px var(--ob-font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms, border-color 120ms, transform 120ms, box-shadow 120ms, color 120ms;
}
.ob-auth-btn:active { transform: scale(0.98); }
.ob-auth-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(26,107,60,0.3); }
.ob-auth-btn-primary { background: var(--ob-primary); color: #fff; }
.ob-auth-btn-primary:hover { background: var(--eucalyptus-600); color: #fff; }
.ob-auth-btn-outline {
  background: #fff;
  color: var(--ob-fg-1);
  border-color: var(--ob-border-input);
}
.ob-auth-btn-outline:hover { background: var(--ob-surface-2); border-color: var(--ob-border-2); color: var(--ob-fg-1); }
.ob-auth-btn-outline i { font-size: 17px; }

.ob-auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 14px;
  color: var(--ob-fg-3); font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.ob-auth-divider::before, .ob-auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--ob-border-1);
}

.ob-auth-sso-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 8px;
}
@media (max-width: 380px) { .ob-auth-sso-grid { grid-template-columns: 1fr; } }

.ob-auth-gicon { width: 18px; height: 18px; display: inline-block; flex-shrink: 0; }

.ob-auth-register {
  text-align: center;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--ob-border-1);
  font-size: 13px; color: var(--ob-fg-2);
}
.ob-auth-register a { color: var(--ob-fg-link); font-weight: 600; text-decoration: none; }
.ob-auth-register a:hover { text-decoration: underline; }

.ob-auth-footnote {
  position: fixed; left: 0; right: 0; bottom: 14px;
  text-align: center;
  font-size: 11px; color: rgba(241, 244, 240, 0.55);
  z-index: 0;
  pointer-events: none;
}
.ob-auth-footnote a { color: rgba(241, 244, 240, 0.8); text-decoration: none; pointer-events: auto; margin: 0 8px; }
.ob-auth-footnote a:hover { color: #fff; text-decoration: underline; }

/* Touch — bump up control sizes on coarse pointer */
@media (pointer: coarse), (max-width: 480px) {
  .ob-auth-input, .ob-auth-btn { height: 48px; font-size: 15px; }
}
