/* ==========================================================================
   lock.css - lock screen, sign-in screen, and the "Welcome" boot screen
   ========================================================================== */

/* --------------------------------------------------------------------------
   LOCK SCREEN
   -------------------------------------------------------------------------- */
#lockscreen {
  z-index: 90;
  background: #0a1620;
  transition: transform var(--dur-slow) var(--ease-in),
              opacity var(--dur-slow) var(--ease-in);
  will-change: transform;
}

/* Dragging the lock screen up follows the pointer 1:1 - no transition while
   the pointer is down, so the JS can drive `transform` directly. */
#lockscreen.is-dragging { transition: none; }

/* Committed unlock: slides fully off the top, as Windows 8 did. */
#lockscreen.is-unlocking {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* A dusk scene built entirely from gradients, so the project stays
   asset-free while still reading as a photographic wallpaper. */
.lock-wallpaper {
  position: absolute;
  inset: 0;
  background:
    /* foreground ridge */
    radial-gradient(ellipse 120% 46% at 22% 118%, #050b10 0 58%, transparent 60%),
    radial-gradient(ellipse 95% 40% at 78% 122%, #071018 0 58%, transparent 60%),
    /* mid hills */
    radial-gradient(ellipse 90% 36% at 48% 108%, #0b1c26 0 60%, transparent 62%),
    /* distant range */
    radial-gradient(ellipse 130% 30% at 65% 100%, #102b38 0 60%, transparent 62%),
    /* sun bloom */
    radial-gradient(circle 480px at 68% 74%, rgba(255, 176, 92, 0.32), transparent 65%),
    radial-gradient(circle 190px at 68% 76%, rgba(255, 214, 150, 0.5), transparent 70%),
    /* sky */
    linear-gradient(178deg, #0d2033 0%, #1d4a63 34%, #38788c 56%, #8ea888 74%, #d9a06a 88%, #f0b878 100%);
  transform: scale(1.04);
  animation: lock-drift 26s var(--ease-std) infinite alternate;
}

@keyframes lock-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.09) translate3d(-1.2%, -0.8%, 0); }
}

/* Windows 8 darkened the top of the wallpaper so the clock always had
   contrast, regardless of the picture behind it. */
.lock-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0.22) 32%,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.3) 100%
  );
}

.lock-content {
  position: absolute;
  top: 8vh;
  left: clamp(28px, 5vw, 76px);
  animation: lock-in 700ms var(--ease-out) both;
}

@keyframes lock-in {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

.lock-time {
  font-family: var(--font-light);
  font-weight: 200;
  font-size: clamp(72px, 10.5vw, 152px);
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.42);
  font-variant-numeric: tabular-nums;
}

.lock-date {
  font-family: var(--font-light);
  font-weight: 300;
  font-size: clamp(19px, 2.5vw, 38px);
  line-height: 1.2;
  margin-top: 0.15em;
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.42);
}

/* Notification badges: app glyph plus an unread count, exactly as the lock
   screen's "quick status" row worked. */
.lock-badges {
  position: absolute;
  left: clamp(28px, 5vw, 76px);
  bottom: clamp(36px, 6vh, 72px);
  display: flex;
  align-items: center;
  gap: 26px;
  animation: lock-in 700ms 140ms var(--ease-out) both;
}

.lock-badge {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.94);
  filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.5));
}
.lock-badge svg { width: 24px; height: 24px; }
.lock-badge-count {
  font-size: 21px;
  font-weight: 300;
  font-family: var(--font-light);
}

.lock-hint {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  animation: hint-pulse 2.8s ease-in-out 1.6s infinite;
  white-space: nowrap;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.42; }
  50%      { opacity: 0.92; }
}

/* --------------------------------------------------------------------------
   SIGN-IN SCREEN
   -------------------------------------------------------------------------- */
#loginscreen {
  z-index: 80;
  background: var(--accent);
  display: grid;
  place-items: center;
  transition: opacity var(--dur-med) var(--ease-std);
}
#loginscreen.is-leaving { opacity: 0; pointer-events: none; }

.login-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-4vh);
  animation: login-in 420ms var(--ease-out) both;
}

@keyframes login-in {
  from { opacity: 0; transform: translateY(calc(-4vh + 26px)); }
  to   { opacity: 1; transform: translateY(-4vh); }
}

/* Square avatar - Windows 8 user pictures were never circular. */
.login-avatar,
.boot-avatar,
.start-user-pic {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-family: var(--font-light);
  font-weight: 300;
  letter-spacing: 0.02em;
}

.login-avatar {
  width: 132px;
  height: 132px;
  font-size: 52px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.login-name {
  margin-top: 22px;
  font-family: var(--font-light);
  font-weight: 200;
  font-size: 42px;
  line-height: 1.1;
  text-align: center;
}

.login-form { margin-top: 26px; }

.login-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.login-input {
  width: 260px;
  height: 34px;
  padding: 0 10px;
  background: #fff;
  color: #1a1a1a;
  font-size: 15px;
  border: 2px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-std);
}
.login-input::placeholder { color: #8a8a8a; }
/* The border darkening is the focus indicator; Windows 8 never drew a dotted
   ring here, and the caret already marks the insertion point. */
.login-input:focus,
.login-input:focus-visible { border-color: rgba(0, 0, 0, 0.42); outline: none; }

/* Submit arrow - a bordered square with a right chevron. */
.login-submit {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  transition: background-color var(--dur-fast) var(--ease-std),
              color var(--dur-fast) var(--ease-std);
}
.login-submit::before {
  content: '';
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, 2px);
}
.login-submit:hover { background: rgba(255, 255, 255, 0.2); }
.login-submit:active { background: #fff; color: var(--accent); }

.login-hint {
  margin-top: 14px;
  font-size: 13px;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

/* Wrong-password shake, kept because it's the one bit of login feedback
   Windows 8 animated. */
.login-form.is-wrong { animation: shake 380ms var(--ease-std); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-9px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}

/* --------------------------------------------------------------------------
   POWER-UP

   The screen a restart or a power-on comes back through. Black, because a
   machine coming up has no accent colour yet - that arrives with the desktop.
   Two phases: firmware, then the logo with the spinner under it.
   -------------------------------------------------------------------------- */
#powerupscreen {
  z-index: 90;
  background: #000;
  display: grid;
  place-items: center;
  transition: opacity 400ms var(--ease-std);
}
#powerupscreen.is-leaving { opacity: 0; pointer-events: none; }

.powerup-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-2vh);
}

/* Phase one is the firmware line alone; the mark and spinner arrive with
   `is-loading`, which is what makes a cold start feel longer than a restart
   rather than just slower. */
.powerup-mark {
  color: #fff;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 620ms var(--ease-out), transform 620ms var(--ease-out);
}
.powerup-mark svg { display: block; }

.powerup-name {
  margin-top: 16px;
  font-family: var(--font-light);
  font-weight: 200;
  font-size: 30px;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 620ms 120ms var(--ease-out), transform 620ms 120ms var(--ease-out);
}

.powerup-ring {
  margin-top: 34px;
  opacity: 0;
  transition: opacity 400ms 360ms var(--ease-std);
}

#powerupscreen.is-loading .powerup-mark,
#powerupscreen.is-loading .powerup-name {
  opacity: 1;
  transform: none;
}
#powerupscreen.is-loading .powerup-ring { opacity: 1; }

/* The firmware line sits where an OEM would put its own: bottom of the
   screen, small, and easy to miss - which is the point. */
.powerup-firmware {
  position: absolute;
  bottom: 6vh;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.26);
  animation: fade-in 700ms 200ms var(--ease-std) both;
}

@media (prefers-reduced-motion: reduce) {
  .powerup-mark,
  .powerup-name,
  .powerup-ring { transition: none; }
}

/* --------------------------------------------------------------------------
   WELCOME / BOOT SCREEN
   -------------------------------------------------------------------------- */
#bootscreen {
  z-index: 75;
  background: var(--accent);
  display: grid;
  place-items: center;
  transition: opacity var(--dur-med) var(--ease-std);
}
#bootscreen.is-leaving { opacity: 0; pointer-events: none; }

.boot-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-3vh);
}

.boot-avatar {
  width: 108px;
  height: 108px;
  font-size: 42px;
}

.boot-word {
  margin-top: 20px;
  font-family: var(--font-light);
  font-weight: 200;
  font-size: 40px;
}

/* The five-dot orbiting spinner. The shared easing makes the dots bunch on
   one side of the circle and fan out on the other - the detail that makes
   this spinner recognisably Windows 8 rather than a generic loader. */
.boot-ring {
  position: relative;
  width: 62px;
  height: 62px;
  margin-top: 30px;
}
.boot-ring span {
  position: absolute;
  inset: 0;
  animation: boot-orbit 1.9s cubic-bezier(0.42, 0.06, 0.58, 0.94) infinite;
}
.boot-ring span::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #fff;
}
.boot-ring span:nth-child(1) { animation-delay: 0ms; }
.boot-ring span:nth-child(2) { animation-delay: 130ms; }
.boot-ring span:nth-child(3) { animation-delay: 260ms; }
.boot-ring span:nth-child(4) { animation-delay: 390ms; }
.boot-ring span:nth-child(5) { animation-delay: 520ms; }

@keyframes boot-orbit {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
