/* ---------- Auth screen ----------

   Split marquee: a cinema-lobby hero (left) carrying the brand, next to a
   corkboard-pinned paper card (right) that holds the actual form — the
   same "raised sticker" + "pinned paper" languages the rest of the app
   already uses (stat cards, the open-collection stats strip, cards' tape
   corners), instead of a generic centered auth card. Stacks on narrow
   screens (see responsive.css). */

.auth-screen {
  /* Colors: .brand-theme (base.css), set on the element in index.html. */
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  overflow-y: auto;
}

/* ---------- hero (brand) ---------- */

.auth-hero {
  flex: 1 1 56%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  padding: 60px 64px;
  overflow: hidden;
  background: radial-gradient(
      120% 100% at 20% 0%,
      color-mix(in srgb, var(--accent-strong) 20%, transparent),
      transparent 60%
    ),
    /* Same corkboard speckle as the app's own body background (base.css),
       so a mostly-empty stretch of the pane still reads as the corkboard,
       not a flat gradient. */
      radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.04) 0 2px, transparent 3px),
    radial-gradient(circle at 60% 70%, rgba(0, 0, 0, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.03) 0 2px, transparent 3px),
    var(--bg-elevated);
  background-size: 100% 100%, 70px 70px, 90px 90px, 110px 110px, 100% 100%;
}

/* Loose taped-up rectangles standing in for posters — plain gradient
   blocks, not real artwork: there's no library to draw posters from
   before you're signed in, and this reads fine as pure decoration. Spread
   across the whole pane (not just tucked beside the card) so a wide
   window doesn't leave most of it empty; a soft blur keeps them reading
   as background clutter instead of competing with the actual title/form.
   Every third one mixes in --pop (the same blue the sidebar's own section
   labels use next to all this purple) so the wall isn't a single flat hue. */
.auth-hero-collage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.auth-hero-poster {
  position: absolute;
  display: block;
  width: 110px;
  aspect-ratio: 2 / 3;
  background: var(--paper);
  padding: 6px 6px 10px;
  box-shadow: 3px 10px 20px rgba(0, 0, 0, 0.5);
  filter: blur(0.5px);
}

.auth-hero-poster::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--accent) 60%, transparent),
    color-mix(in srgb, var(--accent-deep) 80%, transparent)
  );
}

.auth-hero-poster:nth-child(3n)::before {
  background: linear-gradient(
    150deg,
    color-mix(in srgb, var(--pop) 55%, transparent),
    color-mix(in srgb, var(--accent-deep) 80%, transparent)
  );
}

.auth-hero-poster:nth-child(1)  { top: 3%;   left: 4%;   width: 92px;  opacity: 0.3;  transform: rotate(9deg); }
.auth-hero-poster:nth-child(2)  { top: 1%;   left: 42%;  width: 104px; opacity: 0.26; transform: rotate(-6deg); }
.auth-hero-poster:nth-child(3)  { top: 5%;   left: 79%;  width: 118px; opacity: 0.34; transform: rotate(7deg); }
.auth-hero-poster:nth-child(4)  { top: 17%;  left: -4%;  width: 108px; opacity: 0.24; transform: rotate(-10deg); }
.auth-hero-poster:nth-child(5)  { top: 23%;  left: 61%;  width: 96px;  opacity: 0.3;  transform: rotate(5deg); }
.auth-hero-poster:nth-child(6)  { top: 32%;  left: 88%;  width: 126px; opacity: 0.36; transform: rotate(-8deg); }
.auth-hero-poster:nth-child(7)  { top: 70%;  left: 22%;  width: 88px;  opacity: 0.26; transform: rotate(11deg); }
.auth-hero-poster:nth-child(8)  { top: 55%;  left: 47%;  width: 104px; opacity: 0.3;  transform: rotate(-4deg); }
.auth-hero-poster:nth-child(9)  { top: 60%;  left: 73%;  width: 98px;  opacity: 0.28; transform: rotate(8deg); }
.auth-hero-poster:nth-child(10) { top: 68%;  left: 2%;   width: 112px; opacity: 0.24; transform: rotate(-7deg); }
.auth-hero-poster:nth-child(11) { top: 78%;  left: 57%;  width: 90px;  opacity: 0.32; transform: rotate(6deg); }
.auth-hero-poster:nth-child(12) { top: 76%;  left: 85%;  width: 118px; opacity: 0.3;  transform: rotate(-11deg); }
.auth-hero-poster:nth-child(13) { top: 92%;  left: 30%;  width: 100px; opacity: 0.22; transform: rotate(4deg); }
.auth-hero-poster:nth-child(14) { top: 88%;  left: 10%;  width: 94px;  opacity: 0.26; transform: rotate(-5deg); }

.auth-hero-content {
  position: relative;
  z-index: 1;
}

/* Same rounded-square treatment as the sidebar's own logo (.sidebar-logo),
   plus a lifted shadow this one actually needs, sitting over the busier
   poster wall instead of a flat panel. */
.auth-hero-logo {
  display: block;
  width: 60px;
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: 2px 6px 16px rgba(0, 0, 0, 0.5);
}

/* A soft, blurred halo behind the title block so the busier collage never
   fights the one thing on this pane that actually has to be read. */
.auth-hero-content::before {
  content: "";
  position: absolute;
  inset: -30px -44px;
  z-index: -1;
  background: radial-gradient(
    65% 85% at 28% 50%,
    color-mix(in srgb, var(--bg-elevated) 90%, transparent),
    transparent 75%
  );
  filter: blur(20px);
}

.auth-hero-eyebrow {
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 6px;
}

.auth-hero-title {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
}

.auth-hero-copy {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 360px;
  line-height: 1.6;
}

/* ---------- panel (the actual form) ---------- */

.auth-panel {
  flex: 0 0 440px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 40px;
  background: var(--bg);
}

.auth-card {
  position: relative;
  width: min(340px, 100%);
  background: var(--paper);
  color: var(--text);
  padding: 34px 28px 30px;
  box-shadow: 4px 12px 30px rgba(0, 0, 0, 0.45);
  transform: rotate(-1.4deg);
  animation: modal-in 0.25s ease;
}

/* Pinned to the "board": same accent push-pin dot as .stat-card / the
   open-collection stats strip. */
.auth-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: calc(50% - 8px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.45), inset -2px -2px 3px rgba(0, 0, 0, 0.35),
    inset 2px 2px 2px rgba(255, 255, 255, 0.55);
}

.auth-card-tape {
  position: absolute;
  top: -14px;
  right: 24px;
  width: 58px;
  height: 22px;
  background: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.25);
  transform: rotate(8deg);
}

.auth-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 22px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field .field-label {
  margin-top: 0;
}

/* ---------- show/hide password ---------- */

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .field-input {
  padding-right: 42px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--transition);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  color: var(--accent);
}

.auth-password-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Only one eye ever shows: the plain eye is the invitation to reveal the
   password, the slashed one to hide it again once .is-visible is set. */
.auth-password-toggle .icon-eye-off {
  display: none;
}

.auth-password-toggle.is-visible .icon-eye {
  display: none;
}

.auth-password-toggle.is-visible .icon-eye-off {
  display: block;
}

/* Forgot / New Password: a line saying what the card is for. */
.auth-hint {
  margin: -12px 0 20px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
}

/* "Forgot password?" under the password, on the right, quiet until hovered. */
.auth-forgot-btn {
  display: block;
  margin: 8px 0 0 auto;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.auth-forgot-btn:hover,
.auth-forgot-btn:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}

/* Request Access: the message box, its label row and character count. */
.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.auth-optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.auth-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.auth-note {
  resize: vertical;
  min-height: 76px;
  line-height: 1.5;
}

/* The bot trap: in the form, never on screen. */
.auth-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Signed in by a reset link or a temporary password: no way back to the
   page but "Log out". */
.auth-screen[data-mode="reset"] .auth-back,
.auth-screen[data-mode="choose"] .auth-back {
  display: none;
}

.auth-field-error {
  margin-top: 6px;
  font-size: 12px;
  color: #f87171;
}

.auth-message {
  margin: 4px 0 18px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #f87171;
}

.auth-message-ok {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent-glow) 40%, transparent);
  color: var(--accent);
}

/* Same raised-sticker recipe as .add-btn / .sort-btn / the detail modal's
   own action buttons — a hard offset shadow and a slight tilt — instead of
   a flat rounded pill, so signing in reads like every other primary action
   in the app. */
.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  border: none;
  background: var(--accent-strong);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: 3px 4px 0 var(--accent-deep);
  transform: rotate(0.6deg);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}

.auth-submit:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 4px 6px 0 var(--accent-deep);
}

.auth-submit:active {
  transform: rotate(0deg) translateY(0);
  box-shadow: 1px 2px 0 var(--accent-deep);
}

.auth-submit:disabled {
  opacity: 0.7;
  cursor: default;
  transform: none;
}

.auth-toggle {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-toggle-btn {
  margin-left: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-toggle-btn:hover {
  color: var(--text);
}

/* ---------- way back to the landing page ---------- */

.auth-back {
  position: absolute;
  top: 26px;
  left: 30px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px 7px 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 2px 3px 0 var(--accent-deep);
  transform: rotate(-1.5deg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.auth-back:hover {
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 3px 5px 0 var(--accent-deep);
}

.auth-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.auth-back svg {
  width: 15px;
  height: 15px;
}
