/* ==========================================================================
   auth-phone.css — the signed-out landing (#auth-view) on phones and tablets
   (below 900px; the desktop landing is another file and starts at 900px).

   Owner's requests (2026-12-01):
   1. On phone keep the previous design — hero block on top, sign-in section
      below — with the top part a touch lighter or darker than the one under
      it, and the moving glowing line along the border between them.
   2. (follow-up) In dark mode the hero and the card read as one flat layer.
      Make dark match light: the hero's rounded bottom edge must visibly sit
      ON TOP of the sign-in card — a real overlap with a soft shadow cast onto
      the card — so the page reads as two stacked layers. Keep the tone step
      and the glowing seam line.

   What this file does, and nothing else:
   - Dark theme: the hero sits one step DARKER than the sign-in card below it
     (they were the same #123B33; a lighter hero was tried before and he did
     not like it). Light theme keeps its own colours: the deep-green hero on
     the paper card already separates.
   - Both themes: the hero overlaps the card by 18px (its bottom corners are
     already rounded 18px) and casts a soft shadow onto the card, so the two
     sections read as stacked sheets, not one slab. The card's top padding
     grows by the same 18px so its content keeps the clearance it had.
   - The glowing line moves with the seam: with the overlap, the card's top
     edge hides under the hero, so the glint now runs along the hero's bottom
     edge (.auth-intro::after — clipped by the hero's overflow:hidden to its
     rounded shape, so it hugs the curve). It reuses the existing auth-glint
     keyframes from atlas-pages.css: transform-only, cheap on weak phones,
     same 5.5s sweep as before, and it always runs.

   Everything is scoped to #auth-view inside max-width: 899px media queries
   (the 740px block only keeps the compact phone spacing consistent). No
   body-level rules, no other pages. The anim-stuck safeguard in
   atlas-pages.css still applies (the glint is decorative and parks
   off-screen, so nothing is lost if animations never tick). The
   reduced-motion rule below stops the sweep when the device's own
   remove-animations setting is on.
   ========================================================================== */

@media (max-width: 899px) {

  /* DARK ONLY. Light is left exactly as it was. */
  html[data-theme="dark"] #auth-view .auth-intro {
    background: #0D2C25;
    z-index: 2;                    /* above .auth-card (both positioned): the hero overlaps the card */
    margin-bottom: -18px;
    box-shadow: 0 18px 34px -10px rgba(3, 14, 11, .78);
  }
  html[data-theme="dark"] #auth-view .auth-card { padding-top: 34px; }

  /* the animated glint moves from the card's covered top edge to the hero's bottom edge (dark only);
     there is no static seam line */
  html[data-theme="dark"] #auth-view .auth-card::after { content: none; }
  html[data-theme="dark"] #auth-view .auth-intro::after {
    content: ""; position: absolute; z-index: 2; left: 0; right: 0; bottom: 0;
    height: 3px; pointer-events: none;
    background: linear-gradient(90deg, transparent, #C9A45F 35%, #F0DCA9 50%, #C9A45F 65%, transparent);
    transform: translate3d(-100%, 0, 0);
    animation: auth-glint 5.5s ease-in-out 1.6s infinite;
  }
}

/* ---- footer on phones and tablets: same side margin as the page (16px), links wrap inside it, nothing is clipped */
@media (max-width: 899px) {
  #auth-view .auth-site-footer {
    width: auto; max-width: none; box-sizing: border-box;
    margin: 28px 16px 0; padding: 16px 0 24px;
    gap: 10px 14px;
  }
  #auth-view .auth-site-footer > *, #auth-view .auth-site-footer a { min-width: 0; overflow-wrap: anywhere; }
  #auth-view .auth-site-footer .footer-browse { gap: 8px 14px; }
}

/* ---- the device's own remove-animations setting stops the "starts here" sweep too (loaded last, so it wins over the landing files) */
@media (prefers-reduced-motion: reduce) {
  html:root #auth-view .auth-intro h1 .auth-line-accent { animation: none !important; }
}
