/* ============================================================
   PHESTI — sign-in screen (midnight and brass, frosted glass)
   and the welcome moment (the college's colours behind frosted glass).
   Loaded after styles.css; everything here is scoped to .gate.phesti
   and #welcome, so the app inside is untouched.
   ============================================================ */

/* ---------- sign-in ---------- */
.gate.phesti {
  --p-ink: #EFECE7; --p-ink-2: #B3BBC9; --p-line: rgba(239, 236, 231, .16);
  --p-field: rgba(10, 20, 42, .55); --p-edge: #738199; --p-brass: #B08A3E; --p-brass-300: #D7B674;
  background: #0A142A; color: var(--p-ink);
  font-family: "Hanken Grotesk", "Helvetica Neue", system-ui, sans-serif;
}
.gate.phesti .gate__bg {
  background:
    radial-gradient(900px 620px at 80% 28%, rgba(176, 138, 62, .16), transparent 62%),
    radial-gradient(820px 560px at 12% 88%, rgba(44, 66, 116, .55), transparent 62%),
    linear-gradient(160deg, #0A142A 0%, #14213D 58%, #0A142A 100%);
}
.gate.phesti .gate__bg::after { display: none; }
.gate.phesti .gate__waves { display: none; }
.gate__field {
  position: absolute; right: -2%; top: 50%; height: 118%; width: auto; transform: translateY(-50%);
  opacity: .5; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%);
          mask-image: linear-gradient(90deg, transparent, #000 35%);
}
.gate__loop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
@media (max-width: 720px) { .gate__field { right: -30%; opacity: .28; } }
@media (prefers-reduced-motion: reduce) { .gate__loop { display: none; } }

.gate.phesti .gate__card {
  position: relative; width: min(100%, 400px); padding: 36px 32px 30px;
  background: rgba(20, 33, 61, .52);
  -webkit-backdrop-filter: blur(20px) saturate(1.35); backdrop-filter: blur(20px) saturate(1.35);
  border: 1px solid var(--p-line); border-radius: 18px;
  box-shadow: 0 36px 90px -36px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .07);
  color: var(--p-ink);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .gate.phesti .gate__card { background: #14213D; }
}
.gate.phesti .gate__card::before { /* one brass hairline: the record that matters */
  content: ""; position: absolute; left: 32px; right: 32px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--p-brass) 30%, var(--p-brass) 70%, transparent);
}
.gate.phesti .gate__title {
  display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0;
  font: 500 34px/1 "Newsreader", "Iowan Old Style", Georgia, serif; letter-spacing: -.014em; color: var(--p-ink);
}
.gate.phesti .gate__title svg { width: 30px; height: 30px; flex: none; }
.gate.phesti .gate__form { margin-top: 28px; gap: 16px; }
.gate.phesti .field__label { color: var(--p-ink-2); font-size: 13px; font-weight: 500; letter-spacing: .01em; }
.gate.phesti .input {
  background: var(--p-field); color: var(--p-ink); border: 1px solid var(--p-edge); border-radius: 8px;
  min-height: 46px; font: 400 16px/1.2 "Hanken Grotesk", system-ui, sans-serif;
}
.gate.phesti .input::placeholder { color: #8E98AB; }
.gate.phesti .input:focus { outline: 2px solid var(--p-brass-300); outline-offset: 1px; border-color: var(--p-brass-300); box-shadow: none; }
.gate.phesti .field__eye { color: var(--p-ink-2); }
.gate.phesti .btn--primary {
  background: var(--p-ink); color: #0A142A; border-color: var(--p-ink); min-height: 48px;
  font: 600 16px/1 "Hanken Grotesk", system-ui, sans-serif; letter-spacing: 0;
}
.gate.phesti .btn--primary:hover { background: #FFFFFF; border-color: #FFFFFF; }
.gate.phesti .gate__error { color: #F58B84; }
.gate.phesti .gate__ok { color: #65D097; }
.gate.phesti .pending h2, .gate.phesti .pending p { color: var(--p-ink); }

/* Back to the Phesti website: a small frosted button (squared corners, like the website's) */
.gate.phesti .gate__home {
  position: absolute; top: max(20px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); z-index: 2;
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px 0 7px; border-radius: 12px;
  color: var(--p-ink); font: 500 14px/1 "Hanken Grotesk", system-ui, sans-serif; text-decoration: none; letter-spacing: .005em;
  background: rgba(239, 236, 231, .06); border: 1px solid rgba(239, 236, 231, .14);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  transition: background-color .2s ease, border-color .2s ease;
}
.gate__home-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: rgba(239, 236, 231, .1); transition: transform .3s cubic-bezier(.2, .8, .2, 1), background-color .2s ease; }
.gate.phesti .gate__home:hover { background: rgba(239, 236, 231, .1); border-color: rgba(239, 236, 231, .26); }
.gate.phesti .gate__home:hover .gate__home-ico { transform: translateX(-3px); background: rgba(239, 236, 231, .16); }
.gate.phesti .gate__home:focus-visible { outline: 2px solid var(--p-brass-300); outline-offset: 3px; }

/* The college, recognised from the email as it's typed */
.gate__college {
  display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(-4px);
  transition: grid-template-rows .28s cubic-bezier(.2, .8, .2, 1), opacity .22s ease, transform .28s cubic-bezier(.2, .8, .2, 1);
  margin-top: -6px;
}
.gate__college.is-on { grid-template-rows: 1fr; opacity: 1; transform: none; }
.gate__college-inner { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--p-ink); overflow: hidden; min-height: 0; }
.gate__college-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
.gate__college-mark svg, .gate__college-mark img { width: 20px; height: 20px; border-radius: 5px; }
@media (prefers-reduced-motion: reduce) { .gate__college { transition: opacity .15s linear; transform: none; } }

/* ---------- the welcome moment ---------- */
.welcome {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px;
  background: transparent; color: #FFFFFF; overflow: hidden; cursor: default;
  font-family: "Hanken Grotesk", "Helvetica Neue", system-ui, sans-serif;
}
.welcome[hidden] { display: none; }

.welcome__glass {
  position: relative; z-index: 1; text-align: center; width: min(100%, 400px); padding: 44px 32px 40px;
  background: rgba(255, 255, 255, .10);
  -webkit-backdrop-filter: blur(26px) saturate(1.5); backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .24); border-radius: 26px;
  box-shadow: 0 40px 110px -40px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .28);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .welcome__glass { background: rgba(0, 0, 0, .28); }
}
.welcome__mark { display: grid; place-items: center; margin: 0 auto 24px; width: 84px; height: 84px; }
.welcome__mark svg, .welcome__mark img { width: 84px; height: 84px; border-radius: 18px; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .28)); }
.welcome__hello { margin: 0; font-size: 15px; font-weight: 500; letter-spacing: .02em; color: rgba(255, 255, 255, .86); }
.welcome__name { margin: 6px 0 0; font: 500 clamp(36px, 6.4vw, 58px)/1.04 "Newsreader", "Iowan Old Style", Georgia, serif; letter-spacing: -.016em; color: #FFFFFF; text-wrap: balance; }
.welcome__college { display: inline-flex; align-items: center; gap: 10px; margin: 16px 0 0; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .9); }
.welcome__college::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--w-accent, #FFB500); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- arriving and leaving ---------- */
/* The page is midnight from the first paint, so the website's midnight sweep runs straight into this screen. */
.boot { background: transparent; }   /* the aurora shows through while loading */
.boot__spin { border-color: rgba(239, 236, 231, .14); border-top-color: #B08A3E; animation: spin .7s linear infinite, boot-late .3s ease .5s both; }
@keyframes boot-late { from { opacity: 0; } }   /* only shows if loading is slow */
@media (prefers-reduced-motion: no-preference) {
  .gate.phesti:not([hidden]) .gate__bg { animation: gate-bg-in 1.1s ease-out both; }
  .gate.phesti:not([hidden]) .gate__card { animation: gate-card-in 1.1s cubic-bezier(.16, 1, .3, 1) .15s both; will-change: opacity, transform; }
  .gate.phesti:not([hidden]) .gate__home { animation: gate-home-in .6s ease-out .45s both; }
  .gate.phesti.is-leaving .gate__card { animation: gate-card-out .42s cubic-bezier(.4, 0, 1, 1) both; }
  .gate.phesti.is-leaving .gate__home { animation: gate-fade-out .3s ease both; }
  .gate.phesti.is-leaving .gate__bg { animation: gate-fade-out .42s ease both; }
}
@keyframes gate-bg-in { from { opacity: 0; } }
@keyframes gate-card-in { from { opacity: 0; transform: translate3d(0, 14px, 0); } }
@keyframes gate-home-in { from { opacity: 0; transform: translateX(-6px); } }
@keyframes gate-card-out { to { opacity: 0; transform: translate3d(0, 8px, 0); } }
@keyframes gate-fade-out { to { opacity: 0; } }

/* ---------- sign-in backgrounds (CONFIG.GATE_BACKGROUND, or ?bg= to preview) ---------- */
.gate__fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.gate__fx i, .gate__rings { position: absolute; display: none; }
.gate.phesti:not([data-bg="field"]) .gate__field { display: none; }

/* 1 · Stage: one soft spotlight from above, a warm pool on the floor */
.gate.phesti[data-bg="stage"] .gate__bg { background: radial-gradient(70% 55% at 50% 112%, rgba(176, 138, 62, .2), transparent 70%), linear-gradient(180deg, #070F22 0%, #111D38 62%, #0A142A 100%); }
.gate.phesti[data-bg="stage"] .gate__fx i:nth-child(1) { display: block; left: 50%; top: -12%; width: min(110vmin, 1100px); height: 118%; transform: translateX(-50%); filter: blur(28px); }
.gate.phesti[data-bg="stage"] .gate__fx i:nth-child(1)::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(215, 182, 116, .26), rgba(215, 182, 116, .06) 62%, transparent 88%); clip-path: polygon(43% 0, 57% 0, 100% 100%, 0 100%); }
.gate.phesti[data-bg="stage"] .gate__fx i:nth-child(2) { display: block; left: 50%; bottom: 5%; width: min(90vmin, 900px); height: 18vmin; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(215, 182, 116, .2), transparent); filter: blur(12px); }
@media (prefers-reduced-motion: no-preference) {
  .gate.phesti[data-bg="stage"] .gate__fx i:nth-child(-n+2) { animation: fx-breathe 7s ease-in-out infinite alternate; }
}
@keyframes fx-breathe { from { opacity: .72; } to { opacity: 1; } }

/* 2 · Aurora: the shared #aurora shows through (see the end of this file) */
.gate.phesti[data-bg="aurora"], .gate.phesti[data-bg="aurora"] .gate__bg { background: transparent; }

/* 3 · Ripples: thin brass rings widening slowly from behind the card */
.gate.phesti[data-bg="ripples"] .gate__bg { background: radial-gradient(75% 65% at 50% 50%, #14213D, #0A142A 75%); }
.gate.phesti[data-bg="ripples"] .gate__rings { display: block; left: 50%; top: 50%; width: min(160vmax, 2200px); height: min(160vmax, 2200px); transform: translate(-50%, -50%); overflow: visible; }
.gate__rings circle { fill: none; stroke: rgba(215, 182, 116, .32); stroke-width: 1; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; opacity: 0; transform: scale(.12); }
@media (prefers-reduced-motion: no-preference) {
  .gate__rings circle { animation: fx-ripple 15s linear infinite; }
  .gate__rings circle:nth-child(2) { animation-delay: -3s; } .gate__rings circle:nth-child(3) { animation-delay: -6s; }
  .gate__rings circle:nth-child(4) { animation-delay: -9s; } .gate__rings circle:nth-child(5) { animation-delay: -12s; }
}
@media (prefers-reduced-motion: reduce) {
  .gate__rings circle { opacity: .5; } .gate__rings circle:nth-child(1) { transform: scale(.2); } .gate__rings circle:nth-child(2) { transform: scale(.32); }
  .gate__rings circle:nth-child(3) { transform: scale(.46); } .gate__rings circle:nth-child(4) { transform: scale(.62); } .gate__rings circle:nth-child(5) { transform: scale(.8); }
}
@keyframes fx-ripple { 0% { transform: scale(.12); opacity: 0; } 12% { opacity: .9; } 100% { transform: scale(1); opacity: 0; } }

/* 4 · Dots: a fine grid of dots; a soft light follows the mouse */
.gate.phesti[data-bg="dots"] .gate__bg { background: #0A142A; }
.gate.phesti[data-bg="dots"] { --mx: 50vw; --my: 45vh; }
.gate.phesti[data-bg="dots"] .gate__fx {
  background-image: radial-gradient(rgba(239, 236, 231, .26) 1px, transparent 1.6px); background-size: 22px 22px; background-position: center;
  -webkit-mask-image: radial-gradient(circle 360px at var(--mx) var(--my), #000, rgba(0, 0, 0, .3) 60%, rgba(0, 0, 0, .1));
          mask-image: radial-gradient(circle 360px at var(--mx) var(--my), #000, rgba(0, 0, 0, .3) 60%, rgba(0, 0, 0, .1)); }
.gate.phesti[data-bg="dots"] .gate__bg::before { content: ""; position: absolute; left: 0; top: 0; width: 640px; height: 640px; margin: -320px 0 0 -320px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(176, 138, 62, .16), transparent); transform: translate(var(--mx, 50vw), var(--my, 45vh)); pointer-events: none; }

/* 5 · Plain: midnight, a little grain, one brass horizon */
.gate.phesti[data-bg="plain"] .gate__bg { background: linear-gradient(180deg, #0A142A 0%, #101C36 72%, #0A142A 100%); }
.gate.phesti[data-bg="plain"] .gate__fx i:nth-child(1) { display: block; left: 6%; right: 6%; top: 76%; height: 1px; background: linear-gradient(90deg, transparent, rgba(215, 182, 116, .6) 28%, rgba(215, 182, 116, .6) 72%, transparent); }
.gate.phesti[data-bg="plain"] .gate__fx i:nth-child(2) { display: block; left: 18%; right: 18%; top: 76%; height: 160px; transform: translateY(-50%); background: radial-gradient(closest-side, rgba(176, 138, 62, .14), transparent); }
.gate.phesti[data-bg="plain"] .gate__fx::after { content: ""; position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- the aurora ---------- */
.aurora { position: fixed; inset: 0; z-index: 99; overflow: hidden; pointer-events: none;
  background: var(--au-base, #0A142A);
  transition: background-color 1.2s cubic-bezier(.4, 0, .2, 1), opacity .7s ease, visibility 0s linear 0s; }
.aurora.is-off { opacity: 0; visibility: hidden; transition: background-color 1.2s cubic-bezier(.4, 0, .2, 1), opacity .7s ease, visibility 0s linear .7s; }
.aurora__blobs { position: absolute; inset: 0; filter: blur(80px) saturate(1.15); }
.aurora i { position: absolute; border-radius: 50%; will-change: transform; transition: background-color 1.2s cubic-bezier(.4, 0, .2, 1); }
.aurora i:nth-child(1) { width: 58vmax; height: 58vmax; left: -14vmax; top: -18vmax; background: var(--au-a, #23437F); opacity: .8; }
.aurora i:nth-child(2) { width: 46vmax; height: 46vmax; right: -14vmax; top: 6vmax; background: var(--au-b, #0E5866); opacity: .7; }
.aurora i:nth-child(3) { width: 30vmax; height: 30vmax; left: 34vmax; bottom: -16vmax; background: var(--au-c, #B08A3E); opacity: .38; }
@media (prefers-reduced-motion: no-preference) {
  .aurora i:nth-child(1) { animation: au-a 14s ease-in-out var(--au-phase, 0s) infinite; }
  .aurora i:nth-child(2) { animation: au-b 17s ease-in-out var(--au-phase, 0s) infinite; }
  .aurora i:nth-child(3) { animation: au-c 12s ease-in-out var(--au-phase, 0s) infinite; }
}
@media (prefers-reduced-motion: reduce) { .aurora, .aurora i, .aurora.is-off { transition-duration: .2s, .2s, 0s !important; } }
/* The aurora's lights. Same keyframes, durations and clock (--au-phase, set from the time of day in the page's
   <head>) as the website's copy in company/brand/website/assets/site.css, so they line up across the hand-over. */
@keyframes au-a { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 30% { transform: translate3d(9vmax, 5vmax, 0) scale(1.1); } 65% { transform: translate3d(3vmax, 11vmax, 0) scale(.94); } }
@keyframes au-b { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 35% { transform: translate3d(-10vmax, 6vmax, 0) scale(1.08); } 70% { transform: translate3d(-4vmax, -6vmax, 0) scale(.96); } }
@keyframes au-c { 0%, 100% { transform: translate3d(0, 0, 0) scale(1); } 40% { transform: translate3d(-14vmax, -7vmax, 0) scale(1.25); } 75% { transform: translate3d(6vmax, -3vmax, 0) scale(1.05); } }

/* ---------- review fixes (2026-10-06) ---------- */
/* "No access yet" on the midnight card */
.gate.phesti .pending code { color: var(--p-ink); }
.gate.phesti .pending .btn--ghost { background: rgba(239, 236, 231, .06); border-color: var(--p-line); color: var(--p-ink); }
.gate.phesti .pending .btn--ghost:hover { background: rgba(239, 236, 231, .12); color: #FFFFFF; }
.gate.phesti .pending .btn--quiet { color: var(--p-ink-2); }
.gate.phesti .pending .btn--quiet:hover { background: rgba(239, 236, 231, .08); color: var(--p-ink); }
.gate.phesti :focus-visible { outline-color: var(--p-brass-300); }
/* messages show above the sign-in screen and the aurora */
.toasts { z-index: 150; }
/* a phone on its side: the card can scroll without losing its top, the backdrop stays put, the pill keeps clear */
.gate.phesti { place-items: safe center; }
.gate.phesti .gate__bg { position: fixed; }
@media (max-height: 560px) { .gate.phesti { padding-top: calc(max(20px, env(safe-area-inset-top)) + 64px); } }

/* The written-out logo on the sign-in card: "Phesti" with a brass full stop (logo option 8) */
.gate.phesti .gate__title { align-items: baseline; gap: 0; }
.gate__dot { display: inline-block; width: .17em; height: .17em; margin-left: .045em; border-radius: 50%; background: var(--p-brass, #B08A3E); }


