/* Sign-in page: a sunrise over a dark planet fills the whole page; the sign-in form
   floats in a glass card on the right (inspired by "Horizon Bloom" and "Auth 1" from React Bits, rebuilt in plain CSS).
   Always dark. No images, fonts or files from elsewhere. */

body.signin {
  --sun-core: #fff4e8;
  --sun-warm: #ffb27a;
  --sun-rose: #e8679a;
  --sun-violet: #6f5cff;
  --night: #05060b;
  --panel: #0b0d14;
  min-height: 100vh;
  background: var(--night);
  color: #e9ecf3;
}

.signin-shell {
  position: relative; z-index: 1;
  min-height: 100vh; display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: clamp(24px, 5vw, 96px);
  padding: clamp(24px, 6vh, 64px) clamp(20px, 6vw, 96px);
  max-width: 1400px; margin: 0 auto;
}

/* ---------- Right: the sign-in card ---------- */
.signin-card {
  display: grid; gap: 16px;
  animation: card-in .7s cubic-bezier(.16, 1, .3, 1) .35s both;
}
.signin-card .signin-panel {
  padding: 32px 30px 26px;
  background: rgba(11, 12, 20, .66);
  border: 1px solid rgba(255, 255, 255, .09); border-radius: 22px;
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 80px -24px rgba(0, 0, 0, .75), 0 0 0 1px rgba(0, 0, 0, .2);
}
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.signin-logo { margin-bottom: 40px; display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.signin-logo:hover { text-decoration: none; }
.signin .brand-mark .ring { fill: var(--sun-warm); }
.signin .brand-mark .tick { stroke: #1a0f0a; }

.signin-panel { width: 100%; }
.signin-panel h1 { font-size: 28px; letter-spacing: -.025em; margin-bottom: 6px; color: #fff; }
.signin-panel .sub { margin: 0 0 24px; color: #9aa3b5; }
.signin-panel label { margin-top: 16px; color: #c9cfdb; }
.signin-panel input {
  min-height: 44px; padding-left: 40px;
  background: rgba(255, 255, 255, .03); border-color: rgba(255, 255, 255, .1); color: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.signin-panel input:hover { border-color: rgba(255, 255, 255, .18); }
.signin-panel input:focus-visible { outline: 0; border-color: var(--sun-warm); background: rgba(255, 178, 122, .05); box-shadow: 0 0 0 3px rgba(255, 178, 122, .18); }
.signin-panel .field-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: #7d8698; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.signin-panel .field-icon:focus-within > svg { stroke: var(--sun-warm); }
.signin-panel .reveal { color: #7d8698; }
.signin-panel .reveal:hover, .signin-panel .reveal[aria-pressed="true"] { color: #fff; background: rgba(255, 255, 255, .06); }

.signin-panel button.primary {
  width: 100%; min-height: 44px; margin-top: 24px;
  background: linear-gradient(180deg, #fff6ec, #ffd9b8); border: 0; color: #1a0f0a; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(255, 210, 170, .4), 0 8px 24px -8px rgba(255, 150, 90, .55);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.signin-panel button.primary:hover { background: linear-gradient(180deg, #fff6ec, #ffd9b8); filter: brightness(1.04); box-shadow: 0 0 0 1px rgba(255, 210, 170, .6), 0 12px 32px -8px rgba(255, 150, 90, .7); }
.signin-panel button.primary:active { transform: translateY(1px); }
.signin-panel button.primary .spinner { border-color: rgba(26, 15, 10, .25); border-top-color: #1a0f0a; }
.signin-panel .help { margin: 18px 0 0; color: #7d8698; font-size: 13px; text-align: center; }
.signin-panel .demo-hint { background: rgba(255, 178, 122, .07); border-color: rgba(255, 255, 255, .08); border-left-color: var(--sun-warm); color: #d9dee8; }
.auth-error { margin: 0 0 4px; padding: 9px 12px; border: 1px solid rgba(255, 255, 255, .08); border-left: 3px solid #f09a8e; border-radius: var(--radius); background: rgba(240, 154, 142, .1); font-size: 13px; color: #fbd5cf; }
.signin-foot { margin: 0; padding: 0 12px; text-align: center; color: #8a92a5; font-size: 12px; }

@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
.signin-panel.shake { animation: shake .45s ease-in-out; }

/* ---------- The sky: fixed behind the whole page ---------- */
.bloom-sky {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 100%, #120c22 0%, var(--night) 60%);
}

/* Stars: three layers of tiny dots, twinkling slowly. */
.bloom-stars, .bloom-stars::before, .bloom-stars::after {
  position: absolute; inset: 0 0 25% 0; content: "";
  background-repeat: repeat;
}
.bloom-stars {
  background-image: radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,.7), transparent 60%),
                    radial-gradient(1px 1px at 140px 90px, rgba(255,255,255,.5), transparent 60%),
                    radial-gradient(1.5px 1.5px at 90px 160px, rgba(255,240,225,.8), transparent 60%);
  background-size: 210px 200px;
  opacity: .55;
}
.bloom-stars::before {
  background-image: radial-gradient(1px 1px at 60px 50px, rgba(200,210,255,.8), transparent 60%),
                    radial-gradient(1px 1px at 230px 140px, rgba(255,255,255,.6), transparent 60%);
  background-size: 310px 260px;
  animation: twinkle 6s ease-in-out infinite;
}
.bloom-stars::after {
  background-image: radial-gradient(1.2px 1.2px at 120px 20px, rgba(255,230,210,.9), transparent 60%);
  background-size: 390px 330px;
  animation: twinkle 9s ease-in-out 2s infinite;
}
.bloom-stars { -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent); mask-image: linear-gradient(to bottom, #000 40%, transparent); }

/* The planet: a very large dark disc whose top edge is the horizon. */
.bloom-planet {
  position: absolute; left: 50%; top: 70%;
  width: max(260%, 2600px); aspect-ratio: 1; border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle at 50% 0%, #1d1430 0%, #0a0811 7%, #040309 22%);
  box-shadow:
    inset 0 2px 1px -1px rgba(255, 236, 220, .9),
    inset 0 18px 40px -12px rgba(255, 160, 110, .45),
    0 -1px 18px rgba(255, 190, 140, .55),
    0 -24px 80px rgba(232, 103, 154, .28);
}

/* The sun breaking over the edge: layered glow behind the planet. */
.bloom-sun {
  position: absolute; left: 50%; top: 70%;
  width: min(1500px, 140%); aspect-ratio: 2 / 1;
  transform: translate(-50%, -100%);
  background:
    radial-gradient(14% 22% at 50% 100%, var(--sun-core) 0%, rgba(255, 244, 232, 0) 100%),
    radial-gradient(30% 42% at 50% 100%, rgba(255, 178, 122, .85) 0%, rgba(255, 178, 122, 0) 100%),
    radial-gradient(55% 70% at 50% 100%, rgba(232, 103, 154, .45) 0%, rgba(232, 103, 154, 0) 100%),
    radial-gradient(85% 100% at 50% 100%, rgba(111, 92, 255, .28) 0%, rgba(111, 92, 255, 0) 100%);
  filter: blur(6px);
  transform-origin: 50% 100%;
  animation: sunrise 2.6s cubic-bezier(.16, 1, .3, 1) both, bloom 9s ease-in-out 2.6s infinite;
}

/* A bright thin line where the light first touches the rim. */
.bloom-rim {
  position: absolute; left: 50%; top: 70%;
  width: min(900px, 70%); height: 3px;
  transform: translate(-50%, -1px);
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, #fff 0%, rgba(255, 220, 190, .9) 30%, rgba(255, 178, 122, 0) 100%);
  filter: blur(.5px);
  animation: rim 2.6s cubic-bezier(.16, 1, .3, 1) both;
}
.bloom-rim::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 180px; height: 60px; transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(255, 248, 240, .85), rgba(255, 200, 160, 0));
  filter: blur(4px);
}

@keyframes sunrise { from { opacity: 0; transform: translate(-50%, -100%) scaleY(.4) translateY(30%); } to { opacity: 1; transform: translate(-50%, -100%); } }
@keyframes bloom { 0%, 100% { opacity: 1; transform: translate(-50%, -100%) scale(1); } 50% { opacity: .85; transform: translate(-50%, -100%) scale(1.04); } }
@keyframes rim { from { opacity: 0; width: 0; } to { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .9; } 50% { opacity: .25; } }

/* Words over the sky. */
.bloom-copy { max-width: 600px; align-self: start; padding-top: clamp(0px, 4vh, 48px); }
.bloom-eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sun-warm); }
.bloom-title { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.12; letter-spacing: -.03em; color: #fff; font-weight: 650; }
.bloom-sub { margin: 16px 0 0; max-width: 50ch; color: #aab2c3; font-size: 16px; line-height: 1.55; }

/* ---------- Phones and narrow windows: words on top, card below, horizon low ---------- */
@media (max-width: 900px) {
  .signin-shell { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 24px; padding: 24px 16px 40px; }
  .signin-logo { margin-bottom: 20px; }
  .bloom-copy { padding-top: 0; }
  .bloom-title { font-size: 26px; }
  .bloom-sub { display: none; }
  .bloom-planet, .bloom-sun, .bloom-rim { top: 34%; }
  .signin-card .signin-panel { padding: 24px 20px 20px; }
}

/* ---------- Glass sign-in button with a light on its edge (inspired by React Bits "SpecularButton") ----------
   motion.js points the light at the part of the edge nearest the mouse and brightens it as the
   mouse comes close. Without JavaScript it is a quiet glass button with a soft light top-left. */
.signin-panel button.primary.specular {
  position: relative; isolation: isolate;
  background: color-mix(in srgb, #ffd9b8 9%, transparent);
  color: #fff6ec; border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 10px 24px -14px rgba(0, 0, 0, .6);
  filter: none; transition: transform .25s cubic-bezier(.2, .8, .2, 1), background .2s ease;
}
.signin-panel button.primary.specular:hover { background: color-mix(in srgb, #ffd9b8 13%, transparent); filter: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 10px 24px -14px rgba(0, 0, 0, .6); }
.signin-panel button.primary.specular:active { transform: scale(.98); }
.specular::before, .specular::after { content: ""; position: absolute; border-radius: inherit; pointer-events: none; z-index: -1; }
.specular::before {
  inset: 0; padding: 1.5px;
  background: conic-gradient(from calc(var(--sb-angle, 315deg) - 45deg),
    transparent 0deg, rgba(255, 236, 214, .25) 25deg, #fff4e8 45deg, rgba(255, 236, 214, .25) 65deg, transparent 90deg,
    transparent 190deg, rgba(255, 210, 170, .45) 225deg, transparent 260deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: var(--sb-level, .55);
}
.specular::after {
  inset: -6px;
  background: radial-gradient(60% 120% at var(--sb-x, 15%) var(--sb-y, 0%), rgba(255, 200, 160, .3), transparent 70%);
  filter: blur(6px); opacity: var(--sb-level, .55);
}
.specular .label, .specular .spinner { position: relative; }
.signin-panel button.primary.specular .spinner { border-color: rgba(255, 246, 236, .3); border-top-color: #fff6ec; }
