/* The sign-in code and forgot-password screens (templates/auth_screen.html):
   the welcome page's look on a page of their own. The blueprint grid, the
   glows, the floating logo and the glassy card are the landing page's; the
   card rises in when the page opens. Colours are the shared variables. */

.as-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  box-sizing: border-box;
}
.as-page::before {               /* faint blueprint grid, faded to the edges */
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 25%, transparent 78%);
  pointer-events: none;
}
.as-page::after {                /* violet glow from below */
  content: "";
  position: absolute;
  width: 640px; height: 640px;
  left: 50%; bottom: -260px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(106, 63, 214, .14), transparent 60%);
  pointer-events: none;
}

.as-wrap {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.as-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  position: relative;
  text-decoration: none;
}
.as-brand::before {              /* blue halo behind the logo */
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  left: 50%; top: 36px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(61, 129, 246, .2), transparent 62%);
  pointer-events: none;
  z-index: -1;
}
.as-brand img {
  width: 72px; height: 72px;
  border-radius: 26%;
  object-fit: cover;
  filter: drop-shadow(0 0 30px rgba(61, 129, 246, .45)) drop-shadow(0 6px 18px rgba(0, 0, 0, .5));
  animation: as-float 6s ease-in-out infinite;
}
.as-brand .as-word {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--ink-strong);
}
.as-brand .as-word span { color: var(--aqua-bright); }

.as-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(170deg, var(--surface), var(--surface-lo));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .04) inset,
    0 24px 60px rgba(0, 0, 0, .5),
    0 0 90px rgba(61, 129, 246, .08);
  backdrop-filter: blur(12px);
  padding: 30px 28px 26px;
  animation: as-rise .55s cubic-bezier(.2, .8, .2, 1) both;
}
.as-icon {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: radial-gradient(circle at 30% 25%, rgba(61, 129, 246, .35), rgba(61, 129, 246, .08));
  border: 1px solid rgba(61, 129, 246, .35);
  box-shadow: 0 0 28px rgba(61, 129, 246, .25);
  animation: as-pulse 3.2s ease-in-out infinite;
}
.as-icon svg {
  width: 26px; height: 26px;
  fill: none; stroke: var(--aqua-bright); stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.as-card h1 {
  margin: 0 0 6px;
  text-align: center;
  font-size: var(--fs-500);
  color: var(--ink-strong);
}
.as-sub {
  margin: 0 0 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--fs-200);
  line-height: 1.6;
}
.as-sub strong { color: var(--ink); }

.as-field { display: block; margin-bottom: 14px; }
.as-field .as-lab {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: var(--fs-200);
  color: var(--ink-soft);
}
.as-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .35);
  color: var(--ink);
  font-size: var(--fs-300);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.as-field input:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 3px rgba(61, 129, 246, .2);
}
.as-field input::placeholder { color: var(--ink-faint); }

.as-submit {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: none;
  border-radius: 11px;
  font-weight: 700;
  font-size: var(--fs-300);
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--aqua), var(--aqua-dark));
  box-shadow: 0 4px 16px rgba(61, 129, 246, .35);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.as-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(61, 129, 246, .45); }
.as-submit:active { transform: none; }

.as-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 16px;
}
.as-links a, .as-links button {
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: var(--fs-200);
  color: var(--ink-faint);
  text-decoration: none;
  cursor: pointer;
  transition: color .15s;
}
.as-links a:hover, .as-links button:hover { color: var(--ink); }
.as-links form { margin: 0; }

.as-flash {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: var(--fs-200);
  background: rgba(61, 129, 246, .1);
  border: 1px solid rgba(61, 129, 246, .3);
  color: var(--ink);
  animation: as-rise .35s ease-out both;
}
.as-flash.err {
  background: rgba(239, 68, 68, .1);
  border-color: rgba(239, 68, 68, .35);
  color: #fecaca;
}

.as-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-faint);
}

@keyframes as-rise {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes as-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes as-pulse {
  0%, 100% { box-shadow: 0 0 22px rgba(61, 129, 246, .2); }
  50% { box-shadow: 0 0 34px rgba(61, 129, 246, .38); }
}

@media (max-width: 480px) {
  .as-card { padding: 26px 18px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .as-card, .as-brand img, .as-icon, .as-flash { animation: none !important; }
}
