/* auth.css — login/signup avatar, auth modal, notification popover, idle toast.
 * Loaded AFTER mystyle.css so it can extend the static-header avatar/bell.
 * Uses existing :root tokens. Light theme, .5px borders, single accent #1570f0. */

/* ---- avatar: logged-out glow + logged-in initial ------------------------- */
.nav-avatar-initial{
  font: 600 15px/1 var(--f-text);
  color: var(--accent);
  letter-spacing: .2px;
}
.nav-avatar--glow{
  position: relative;
  animation: navAvatarPulse 2.4s ease-in-out infinite;
}
@keyframes navAvatarPulse{
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 34%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce){
  .nav-avatar--glow{ animation: none; }
}

/* ---- auth modal (2-column) ----------------------------------------------- */
/* z-index 200, not 60: the top nav is 100-102 (app.css:73, mystyle.css:112 and :2613), so
   at 60 this modal rendered UNDERNEATH the site header. Fixed 2026-08-01. */
.auth-overlay{
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.42);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-panel{
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  width: min(900px, 96vw); max-height: 92vh; min-height: 520px; overflow: hidden;
  /* 2026-09-24: hidden clips children at the PADDING edge, inside the .5px border, so the
     light border stayed round the video however far .auth-col-left reached. Clip at the
     border box instead (still following the radius); browsers without it keep hidden. */
  overflow: clip; overflow-clip-margin: border-box;
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 18px;
}
.auth-x{
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  /* Owner 2026-09-14: the old pale circle read as nothing on the white column, so the
     close control gets a real border and the site's text colour. One hover affordance. */
  border: 0.5px solid var(--line, #d2d2d7); border-radius: 50%; background: #fff; color: var(--text, #0f1729);
  cursor: pointer; transition: border-color .15s ease;
}
.auth-x svg{ width: 20px; height: 20px; stroke-width: 2; }
.auth-x:hover{ border-color: var(--text, #0f1729); }
.auth-x:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }

/* left: the trailer, full-bleed. No padding — the video fills its whole half of the panel
   (owner request 2026-08-01). The caption sits OVER the video at the top, not above it:
   the bottom is where the native <video controls> bar lives. */
.auth-col-left{
  position: relative;
  /* Owner 2026-09-24: the panel's .5px border and white surface read as a light hairline
     round the video. Overlap the panel's own edge; the panel's border-box clip keeps the
     column inside the rounded shape. */
  margin: -1px 0 -1px -1px;
  background: #0a0b0d;
  border-right: .5px solid var(--border);
  overflow: hidden;
}
.auth-video-wrap{
  position: absolute; inset: 0;
  background: #0a0b0d;
  overflow: hidden;
}
.auth-video{ width: 100%; height: 100%; object-fit: cover; display: block; }
/* Solid scrim, not a gradient — CLAUDE.md bans linear-gradient on backgrounds. */
.auth-video-cap{
  position: absolute; left: 0; right: 0; top: 0; margin: 0;
  padding: 11px 16px;
  font-size: 12.5px; line-height: 1.45; color: #fff;
  background: rgba(10,11,13,.72);
}

/* right: credentials */
.auth-col-right{
  padding: 40px 36px;
  display: flex; flex-direction: column; justify-content: center;
  overflow-y: auto;
}
.auth-title{ font: 700 24px/1.2 var(--f-display); color: var(--text); margin: 0 0 4px; }
.auth-sub{ font-size: 14px; color: var(--text-3); margin: 0 0 22px; }
.auth-section-label{
  text-align: center; font-size: 12px; font-weight: 600; color: var(--text-3);
  margin: 0 0 14px;
}
.auth-btn{
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 16px; margin-bottom: 10px;
  font: 500 14px/1 var(--f-text); cursor: pointer;
  border-radius: var(--r-pill); transition: background-color .15s ease, border-color .15s ease;
}
.auth-btn--oauth{
  background: var(--surface); color: var(--text); border: .5px solid var(--border-2);
}
.auth-btn--oauth:hover{ background: var(--bg-2); }
.auth-btn--email{
  background: var(--text); color: #fff; border: .5px solid var(--text);
}
.auth-btn--email:hover{ background: #000; }
.auth-divider{
  display: flex; align-items: center; gap: 10px; margin: 8px 0 12px;
  color: var(--text-4); font-size: 12px;
}
.auth-divider::before, .auth-divider::after{
  content: ""; flex: 1; height: .5px; background: var(--border);
}
.auth-email-row{ position: relative; margin-bottom: 8px; }
.auth-email-ico{
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-4); display: inline-flex; pointer-events: none;
}
.auth-email-input{
  width: 100%; padding: 11px 14px 11px 36px;
  font: 400 14px/1 var(--f-text); color: var(--text);
  border: .5px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface);
}
.auth-email-input:focus{ outline: none; border-color: var(--accent); }
/* P3-6: visible keyboard-focus ring (border-color alone is too subtle) */
.auth-email-input:focus-visible{ outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-err{ color: var(--danger); font-size: 12.5px; margin: 2px 0 8px; }
.auth-fine{ font-size: 12px; color: var(--text-4); margin: 14px 0 0; line-height: 1.5; }
.auth-fine a{ color: var(--text-3); text-decoration: underline; }
.auth-back{
  align-self: flex-start; background: none; border: none; cursor: pointer;
  color: var(--text-3); font-size: 13px; padding: 0; margin-bottom: 14px;
}
.auth-sent{ text-align: center; }
.auth-sent-ico{
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; color: var(--accent);
  background: var(--accent-tint); margin-bottom: 14px;
}

/* ---- notification popover ------------------------------------------------ */
.bell-pop{
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 340px; max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: .5px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-3);
}
.bell-pop-head{
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 12px 14px 8px; font-weight: 600; font-size: 13px; color: var(--text);
}
.bell-markall{
  background: none; border: none; cursor: pointer; color: var(--text-3);
  font-size: 12px; padding: 0;
}
.bell-markall:hover{ color: var(--accent); text-decoration: underline; }
.bell-pop-list{ border-top: .5px solid var(--border); }
.bell-pop-item{
  position: relative; width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: flex-start; gap: 8px;
  padding: 11px 14px; background: none; border: none; border-bottom: .5px solid var(--border);
  transition: background-color .12s ease;
}
.bell-pop-item:last-child{ border-bottom: none; }
.bell-pop-item:hover{ background: var(--bg-2); }
.bell-pop-body{ flex: 1; display: flex; flex-direction: column; gap: 3px; }
.bell-pop-text{ font-size: 13px; line-height: 1.4; color: var(--text-2); }
.bell-pop-text strong{ color: var(--text); font-weight: 600; }
.bell-time{ font-size: 12px; color: var(--text-4); }
.bell-dot{
  flex: none; width: 6px; height: 6px; margin-top: 6px;
  border-radius: 50%; background: var(--accent);
}

/* ---- avatar account menu -------------------------------------------------
   Anchored off .nav-right{position:relative} like .bell-pop. Deliberately no
   box-shadow: the house rule is a 0.5px border instead. One hover affordance
   (background), no transform, no gradient. */
.acct-pop{
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 176px; padding: 6px;
  background: var(--surface); border: .5px solid var(--border); border-radius: var(--r-md);
}
.acct-pop-item{
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 9px 12px; background: none; border: none; border-radius: var(--r-sm);
  font: 500 13.5px/1 var(--f-text); color: var(--text-2);
  transition: background-color .12s ease;
}
.acct-pop-item:hover{ background: var(--bg-2); }
.acct-pop-item:focus-visible{ outline: 2px solid var(--accent); outline-offset: -2px; }

/* Numbered unread badge on the closed nav bell (green = activity, not alarm). */
.nav-bell{ position: relative; }
.nav-bell-badge{
  position: absolute;
  top: 1px; right: 1px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: #34c759;
  color: #fff;
  font-size: 12px; font-weight: 600; line-height: 15px;
  text-align: center;
  border: 2px solid #1C2226;
  box-sizing: content-box;
  pointer-events: none;
}
.nav-bell-badge[hidden]{ display: none; }

/* the nav-right group anchors the popover */
.nav-right{ position: relative; }

/* ---- idle prompt: the sign-up panel flies out of the avatar -----------------
   The 30s idle nudge used to be a text toast in the bottom-left corner. It is now the real
   sign-up panel, and it animates out of whichever avatar is on screen — the rail's on
   desktop, the tab bar's on a phone — so the prompt visibly comes from the control that
   opens it again later.

   auth.js measures the gap between the avatar's centre and the panel's centre and writes it
   here as --auth-dx/--auth-dy. transform-origin cannot do this job: it resolves against the
   panel's own border box, and the avatar is far outside it. The overlay's dark backdrop is
   deliberately left alone so only the panel travels. */
.auth-overlay--from-avatar .auth-panel{
  animation: authFromAvatar .36s cubic-bezier(.16,1,.3,1) both;
}
@keyframes authFromAvatar{
  from{ opacity: 0; transform: translate(var(--auth-dx, 0px), var(--auth-dy, 0px)) scale(.3); }
  to  { opacity: 1; transform: translate(0, 0) scale(1); }
}
@media (prefers-reduced-motion: reduce){
  .auth-overlay--from-avatar .auth-panel{ animation: none; }
}

/* ---- responsive: collapse to single column ------------------------------- */
/* ---- sign-in gate ---------------------------------------------------------
   The dashboard shell renders BEHIND the panel, blurred, so a visitor sees the product
   they are being invited into instead of an empty page.

   Blur is paint-only. The elements underneath stay clickable and keyboard-focusable, so
   the backdrop also carries inert + aria-hidden in the markup (viewSignInGate, app.js).
   Never treat the blur as the access control — it is decoration. The real gate is the
   route guard, and the run itself is refused server-side. */
.gate-back{
  filter: blur(7px);
  pointer-events: none;
  user-select: none;
}
.gate-modal{
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow-y: auto;
  background: rgba(0,0,0,.28);
}
.auth-panel--gate{ width: min(940px, 96vw); }
/* The idle nudge used to need suppressing here, when it was a corner toast that could
   overlap the gate. It is the sign-up panel itself now, and showIdlePrompt() bails when a
   .gate-modal (or any other popover) is already up, so the guard lives in the code path
   rather than in a display:none. */
/* Below the sign-in options: reassurance, then the way out. The escape link is the
   difference between an invitation and a wall — keep it. */
.gate-foot{ margin: 16px 0 0; text-align: center; }
.gate-foot .auth-fine{ margin: 0 0 10px; }

@media (max-width: 760px){
  .auth-panel{ grid-template-columns: 1fr; max-height: 94vh; min-height: 0; overflow-y: auto; }
  .auth-col-left{ display: none; }
  .auth-col-right{ padding: 40px 24px; }
  .bell-pop{ width: min(340px, 92vw); }
  .gate-modal{ padding: 16px; }
}
