/*
 * Premium sign-in page — Mercy Court palette.
 *
 *   brand-red    #D95A2B   warm burnt-orange / vermillion
 *   brand-dark   #0A0A0A   near-black
 *   brand-footer #1A1A1A   very dark grey
 *
 * The brand panel (desktop) is a near-black canvas with a subtle
 * orange glow — visually continuous with the post-login splash so
 * the sign-in → splash → app flow reads as one piece. The form
 * panel stays clean-white in light mode, near-black in dark mode.
 *
 * PWA standalone is the primary target: safe-area-inset padding,
 * touch-friendly hit areas, no browser chrome to lean on.
 */

:root {
  --auth-brand-deep: #0A0A0A;
  --auth-brand-mid: #1A1A1A;
  --auth-brand-accent: #D95A2B;
  --auth-brand-accent-bright: #f08855;
  --auth-brand-glow: rgba(217, 90, 43, 0.32);
  --auth-form-bg: #ffffff;
  --auth-form-text: #1a1a1a;
  --auth-form-muted: #5b5b67;
  --auth-form-border: rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] {
  --auth-form-bg: #0A0A0A;
  --auth-form-text: #f3f3f7;
  --auth-form-muted: #a8a8b8;
  --auth-form-border: rgba(255, 255, 255, 0.08);
}

html, body { height: 100%; }
body { font-family: 'Lato', 'Inter', system-ui, -apple-system, sans-serif; }

.auth-premium {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--auth-form-bg);
  /* PWA standalone — sit inside notch/rounded-screen safe area. */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── Brand panel (desktop, ≥992px) ─────────────────────────────────── */

.auth-brand-panel {
  position: relative;
  display: none;
  flex: 1 1 55%;
  overflow: hidden;
  /* Layered radial glows over near-black — matches the splash bg. */
  background:
    radial-gradient(ellipse 60% 50% at 75% 18%, var(--auth-brand-glow), transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 85%, rgba(217, 90, 43, 0.12), transparent 65%),
    linear-gradient(160deg, var(--auth-brand-deep) 0%, var(--auth-brand-mid) 100%);
  color: #fff;
}

@media (min-width: 992px) {
  .auth-brand-panel {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Decorative orbits — subtle, behind content. */
.auth-brand-panel::before,
.auth-brand-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand-panel::before {
  width: 540px;
  height: 540px;
  left: -180px;
  bottom: -180px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: radial-gradient(circle, rgba(217, 90, 43, 0.06), transparent 70%);
}

.auth-brand-panel::after {
  width: 320px;
  height: 320px;
  right: -110px;
  top: -110px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  max-width: 460px;
  padding: 3rem;
  text-align: center;
  animation: auth-brand-fade-in 800ms ease 120ms both;
}

.auth-brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  margin-bottom: 2rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 100px var(--auth-brand-glow);
}

.auth-brand-logo img {
  max-width: 96px;
  max-height: 96px;
  object-fit: contain;
}

.auth-brand-name {
  font-family: 'Anton', 'Lato', sans-serif;
  font-size: 2.4rem;
  font-weight: 400; /* Anton is its own weight; don't bold-blur it. */
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: #fff;
}

.auth-brand-rule {
  width: 56px;
  height: 3px;
  margin: 1.25rem auto;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--auth-brand-accent), var(--auth-brand-accent-bright));
}

.auth-brand-tagline {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
}

.auth-brand-quote {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(217, 90, 43, 0.85);
}

@keyframes auth-brand-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form panel ────────────────────────────────────────────────────── */

.auth-form-panel {
  display: flex;
  flex: 1 1 45%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background: var(--auth-form-bg);
  color: var(--auth-form-text);
  animation: auth-form-fade-in 600ms ease 60ms both;
}

.auth-form-inner {
  width: 100%;
  max-width: 420px;
}

/* Compact brand header — mobile / tablet only. */
.auth-mobile-brand {
  text-align: center;
  margin-bottom: 2.25rem;
}

.auth-mobile-brand img {
  max-height: 72px;
  margin-bottom: 1rem;
}

.auth-mobile-brand-name {
  font-family: 'Anton', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--auth-form-text);
}

.auth-mobile-brand-sub {
  color: var(--auth-form-muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (min-width: 992px) {
  .auth-mobile-brand { display: none; }
}

.auth-form-heading {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  color: var(--auth-form-text);
}

.auth-form-sub {
  margin-bottom: 2rem;
  color: var(--auth-form-muted);
}

.auth-form-panel .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--auth-form-text);
  margin-bottom: 0.5rem;
}

.auth-form-panel .form-control,
.auth-form-panel .input-group-text {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  font-size: 1rem;
  border-color: var(--auth-form-border);
  background: var(--auth-form-bg);
  color: var(--auth-form-text);
}

.auth-form-panel .form-control:focus {
  border-color: var(--auth-brand-accent);
  box-shadow: 0 0 0 0.2rem rgba(217, 90, 43, 0.18);
  background: var(--auth-form-bg);
}

.auth-form-panel .input-group-text {
  color: var(--auth-form-muted);
}

.btn-auth-submit {
  padding: 0.9rem 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.95rem;
  border: 0;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--auth-brand-accent), var(--auth-brand-accent-bright));
  color: #fff;
  box-shadow: 0 10px 28px rgba(217, 90, 43, 0.36);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-auth-submit:hover,
.btn-auth-submit:focus {
  background: linear-gradient(135deg, var(--auth-brand-accent-bright), var(--auth-brand-accent));
  box-shadow: 0 12px 32px rgba(217, 90, 43, 0.46);
  transform: translateY(-1px);
  color: #fff;
}

.btn-auth-submit:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn-auth-passkey {
  padding: 0.8rem 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid var(--auth-brand-accent);
  color: var(--auth-brand-accent);
  background: transparent;
  border-radius: 0.5rem;
}

.btn-auth-passkey:hover,
.btn-auth-passkey:focus {
  background: rgba(217, 90, 43, 0.08);
  color: var(--auth-brand-accent);
  border-color: var(--auth-brand-accent);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: var(--auth-form-muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-form-border);
}

.auth-divider::before { margin-right: 1rem; }
.auth-divider::after  { margin-left: 1rem; }

.auth-helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.auth-helper-row a {
  color: var(--auth-brand-accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-helper-row a:hover {
  color: var(--auth-brand-accent-bright);
  text-decoration: underline;
}

.auth-form-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--auth-form-border);
  text-align: center;
  color: var(--auth-form-muted);
  font-size: 0.78rem;
}

.auth-form-footer a {
  color: var(--auth-form-muted);
  text-decoration: none;
  margin: 0 0.6rem;
}

.auth-form-footer a:hover { color: var(--auth-brand-accent); }

.auth-form-footer-meta {
  margin-top: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--auth-form-muted);
  opacity: 0.7;
}

/* ── Cinema entry — fields cascade in ──────────────────────────────── */

.auth-form-inner > * {
  opacity: 0;
  animation: auth-stagger 500ms ease forwards;
}
.auth-mobile-brand    { animation-delay:  60ms; }
.auth-form-heading    { animation-delay: 180ms; }
.auth-form-sub        { animation-delay: 240ms; }
.auth-form-inner form { animation-delay: 300ms; }
.auth-divider         { animation-delay: 380ms; }
#passkey-sign-in      { animation-delay: 420ms; }
.auth-form-footer     { animation-delay: 520ms; }

@keyframes auth-stagger {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes auth-form-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Reduced motion / accessibility ────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .auth-brand-content,
  .auth-form-panel,
  .auth-form-inner > * {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .btn-auth-submit { transition: none; }
}

/* ── Mobile polish ─────────────────────────────────────────────────── */

@media (max-width: 575px) {
  .auth-form-panel { padding: 2rem 1rem; }
  .auth-form-heading { font-size: 1.45rem; }
  .auth-mobile-brand img { max-height: 60px; }
}
