
html:has(> body.bare-body), body.bare-body { height: 100%; }
.bare-body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--serif);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Override the global main { max-width; padding } for full-bleed bare layouts */
.bare-body > main.auth-shell {
  max-width: none;
  padding: 0;
  margin: 0;
}

.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}
/* Base mobile responsive that must apply to .auth-shell/.auth-hero. Further
   overrides live at the end of the file so they win over later base rules. */

/* ─── Left hero panel ─── */
.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 3rem 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  color: #f7ede0;
  min-height: 100vh;
  isolation: isolate;
}
@media (max-width: 880px) { .auth-hero { min-height: auto; padding: 2rem 1.5rem; } }

.auth-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1200px 800px at 30% 20%, rgba(224, 138, 90, 0.22), transparent 65%),
    radial-gradient(900px 600px at 85% 90%, rgba(122, 29, 29, 0.35), transparent 65%),
    linear-gradient(165deg, #1a1410 0%, #1f1710 60%, #14100c 100%);
}
.auth-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(247, 237, 224, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 237, 224, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 40% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 40% 40%, black 20%, transparent 75%);
  pointer-events: none;
}

.auth-back {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(247, 237, 224, 0.55);
  text-decoration: none;
  transition: color 160ms ease;
  align-self: flex-start;
}
.auth-back:hover { color: #f4b78a; }

.auth-hero-inner {
  margin-top: auto;
  margin-bottom: auto;
  max-width: 500px;
}

.auth-hero-mark {
  color: #f7ede0;
  margin-bottom: 2.4rem;
  opacity: 0;
  transform: translateY(16px);
  animation: heroFade 900ms 120ms cubic-bezier(0.16, 0.84, 0.32, 1) forwards;
}
.auth-hero-mark svg { filter: drop-shadow(0 14px 32px rgba(0,0,0,0.3)); }

.auth-hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(224, 138, 90, 0.9);
  margin: 0 0 1.4rem;
  opacity: 0;
  animation: heroFade 900ms 220ms cubic-bezier(0.16, 0.84, 0.32, 1) forwards;
}

.auth-hero-quote {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  font-style: italic;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: rgba(247, 237, 224, 0.92);
  margin: 0;
  max-width: 30ch;
  opacity: 0;
  transform: translateY(12px);
  animation: heroFade 900ms 320ms cubic-bezier(0.16, 0.84, 0.32, 1) forwards;
}

@keyframes heroFade { to { opacity: 1; transform: translateY(0); } }

/* ─── Right panel · the form ─── */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 2.5rem;
  background: var(--bg);
}
.auth-panel-inner {
  width: 100%;
  max-width: 380px;
  opacity: 0;
  transform: translateY(16px);
  animation: heroFade 900ms 260ms cubic-bezier(0.16, 0.84, 0.32, 1) forwards;
}

.auth-eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
}

.auth-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.2rem, 4.2vw, 2.8rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
  line-height: 1.05;
  color: var(--ink);
}
.auth-title-mark { display: inline-flex; align-items: baseline; color: var(--ink); }
.auth-title-mark svg { color: var(--ink); margin-right: 0.02em; }

.auth-blurb {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 2.4rem;
  line-height: 1.5;
}

/* Google button · clean, no shine sweep, no arrow */
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 13px 20px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 120ms ease;
}
.btn-google:hover { border-color: var(--ink); background: var(--bg); }
.btn-google:active { transform: scale(0.995); }
.btn-google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-divider {
  text-align: center;
  margin: 2rem 0 1.6rem;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 36px);
  height: 1px;
  background: var(--rule-soft);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-divider span {
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--bg);
  padding: 0 0.9rem;
  position: relative;
}

/* Floating-label form fields · quieter lines */
.auth-form { display: flex; flex-direction: column; gap: 1.6rem; }
.auth-field {
  position: relative;
  padding-top: 0.9rem;
}
.auth-field input {
  width: 100%;
  padding: 13px 0 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule-soft);
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  outline: none;
  transition: border-color 200ms ease;
}
.auth-field label {
  position: absolute;
  left: 0;
  top: 22px;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-faint);
  pointer-events: none;
  transition: transform 280ms cubic-bezier(0.16, 0.84, 0.32, 1), color 200ms ease, font-size 200ms ease, letter-spacing 200ms ease;
  transform-origin: left top;
}
.auth-field input:focus + label,
.auth-field input:not(:placeholder-shown) + label {
  transform: translateY(-28px) scale(0.7);
  color: var(--ink-soft);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.auth-field-line {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms cubic-bezier(0.16, 0.84, 0.32, 1);
}
.auth-field input:focus ~ .auth-field-line { transform: scaleX(1); }

.btn-auth-primary {
  padding: 14px 20px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-radius: 10px;
  transition: transform 140ms ease, background 200ms ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  position: relative;
  overflow: hidden;
}
.btn-auth-primary:hover { background: var(--accent); }
.btn-auth-primary:active { transform: scale(0.995); }
.btn-auth-primary[data-loading="true"] { pointer-events: none; }
.btn-auth-primary[data-loading="true"] .btn-auth-label { opacity: 0; }
.btn-auth-spinner {
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  animation: spin 700ms linear infinite;
}
.btn-auth-primary[data-loading="true"] .btn-auth-spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-toggle {
  text-align: center;
  margin: 1rem 0 0;
  font-size: 0.85rem;
  font-family: var(--sans);
}
.auth-toggle a {
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 160ms ease;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.auth-toggle a:hover { color: var(--ink); border-bottom-color: var(--ink); }

.auth-consent { font-size: 0.7rem; color: var(--ink-faint); text-align: center; margin: 0.7rem 0 0; line-height: 1.55; font-family: var(--sans); }
.auth-consent a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }

.auth-err {
  color: #b04747;
  font-size: 0.85rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  background: rgba(176, 71, 71, 0.08);
  border-left: 3px solid #b04747;
  border-radius: 3px;
  font-family: var(--sans);
  animation: shake 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.auth-legal {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-faint);
  margin: 1.8rem 0 0;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  .auth-hero-mark, .auth-hero-eyebrow, .auth-hero-quote, .auth-panel-inner { opacity: 1; transform: none; animation: none; }
}

/* ─── Responsive overrides (at the end so they win over base rules) ─── */
@media (max-width: 880px) {
  .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-hero { min-height: auto; padding: 1.2rem 1.5rem 1.5rem; }
  .auth-back { font-size: 0.68rem; margin-bottom: 0.5rem; }
  .auth-hero-inner { margin: 0; max-width: none; }
  .auth-hero-mark svg { width: 68px; height: 68px; }
  .auth-hero-mark { margin-bottom: 0.8rem; }
  .auth-hero-eyebrow { font-size: 0.62rem; letter-spacing: 0.36em; margin-bottom: 0.6rem; }
  .auth-hero-quote { font-size: 1.05rem; line-height: 1.3; max-width: none; }
  .auth-panel { padding: 2rem 1.5rem 2.5rem; }
  .auth-panel-inner { max-width: none; }
  .auth-title { font-size: 1.9rem; }
  .auth-blurb { font-size: 0.95rem; margin-bottom: 1.6rem; }
  .auth-form { gap: 1.3rem; }
}

@media (max-width: 480px) {
  .auth-hero-mark svg { width: 56px; height: 56px; }
  .auth-hero-quote { font-size: 0.95rem; }
  .auth-title { font-size: 1.7rem; }
  .auth-panel { padding: 1.5rem 1.2rem 2rem; }
}

/* ─── Inline auth modal (opens on the current page instead of routing) ─── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.auth-modal[hidden] { display: none; }
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: authFade 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.auth-modal-panel {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 2.5rem 2.2rem 2.2rem;
  max-width: 440px;
  width: 100%;
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.35), 0 4px 12px -4px rgba(0,0,0,0.15);
  animation: authIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.auth-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 4px;
  transition: color 120ms ease, background 120ms ease;
}
.auth-modal-close:hover { color: var(--accent); background: var(--rule-soft); }
.auth-modal-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.8rem;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.auth-modal-mark { display: inline-flex; align-items: baseline; color: var(--ink); }
.auth-modal-mark svg { color: var(--ink); margin-right: 0.02em; }
.auth-modal-blurb {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 1.4rem;
  font-size: 0.95rem;
  line-height: 1.4;
}
@keyframes authFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes authIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
body[data-modal-open="true"] { overflow: hidden; }

@media (max-width: 480px) {
  .auth-modal { padding: 0; align-items: stretch; }
  .auth-modal-panel { max-height: 100dvh; border: none; border-top: 1px solid var(--rule); animation: authInMobile 280ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  @keyframes authInMobile {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
