/* ═══════════════════════════════════════════════════════════════
   BPE/U — OOBE, Login, Boot Screen Styles
   Matches AURORA OS design tokens
   ═══════════════════════════════════════════════════════════════ */

/* ── OOBE Screen ── */
.oobe {
  position: fixed; inset: 0; z-index: 100000;
  display: none; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0b0f14 0%, #111827 50%, #0b0f14 100%);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #e6eef6;
  overflow: hidden;
}
.oobe::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(71,145,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(31,210,182,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.oobe.active { display: flex; }
.oobe.oobe-exit { animation: oobe-exit 500ms var(--easing-smooth, cubic-bezier(.22,.12,.36,1)) forwards; }

.oobe-card {
  position: relative; z-index: 1;
  background: rgba(15, 23, 32, 0.85);
  border: 1px solid rgba(71, 145, 255, 0.15);
  border-radius: 20px;
  padding: 24px 32px;
  max-width: 480px; width: 90vw;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.oobe-fade-in { animation: oobe-fade-in 400ms var(--easing-smooth, cubic-bezier(.22,.12,.36,1)) both; }

.oobe-logo { text-align: center; margin-bottom: 20px; }
.oobe-title {
  font-size: 22px; font-weight: 600; text-align: center; margin: 0 0 4px;
  background: linear-gradient(135deg, #4791ff, #1fd2b6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.oobe-subtitle { font-size: 13px; color: #aeb9c8; text-align: center; margin: 0 0 14px; }

.oobe-field-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.oobe-label { font-size: 11px; font-weight: 500; color: #7a8a9e; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }
.oobe-input {
  background: rgba(11, 15, 20, 0.8); border: 1px solid rgba(71, 145, 255, 0.2);
  border-radius: 8px; padding: 8px 12px; color: #e6eef6; font-size: 14px;
  font-family: inherit; outline: none; transition: border-color 160ms;
  width: 100%; box-sizing: border-box;
}
.oobe-input:focus { border-color: #4791ff; box-shadow: 0 0 0 3px rgba(71,145,255,0.15); }
.oobe-input::placeholder { color: #5a6a7e; }

.oobe-select {
  appearance: none; -webkit-appearance: none;
  background: rgba(11, 15, 20, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%237a8a9e' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid rgba(71, 145, 255, 0.2);
  border-radius: 10px; padding: 8px 36px 8px 12px; color: #e6eef6; font-size: 14px;
  font-family: inherit; outline: none; cursor: pointer;
  width: 100%; box-sizing: border-box;
}
.oobe-select:focus { border-color: #4791ff; }
.oobe-select option { background: #0f1720; color: #e6eef6; }

.oobe-tz {
  background: rgba(11, 15, 20, 0.5); border: 1px solid rgba(71, 145, 255, 0.1);
  border-radius: 10px; padding: 12px 14px; color: #7a8a9e; font-size: 14px;
}

.oobe-hint { font-size: 11px; color: #f59e0b; }
.oobe-hint:empty { display: none; }
.oobe-error { font-size: 12px; color: #ef4444; text-align: center; }
.oobe-error:empty { display: none; }

.oobe-pass-wrap { position: relative; display: grid; }
.oobe-pass-wrap .oobe-input { padding-right: 44px; grid-area: 1/1; z-index: 0; }
.oobe-pass-toggle {
  grid-area: 1/1; justify-self: end; align-self: center;
  margin-right: 8px; z-index: 2;
  background: none; border: none; color: #7a8a9e; cursor: pointer;
  padding: 0 8px; border-radius: 6px; display: flex; align-items: center;
}

.oobe-btn {
  padding: 10px 24px; border: none; border-radius: 10px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  transition: transform 120ms, box-shadow 160ms, background 160ms;
}
.oobe-btn:active { transform: scale(0.98); }
.oobe-btn.primary {
  background: linear-gradient(135deg, #4791ff, #1fd2b6); color: #fff;
  box-shadow: 0 4px 20px rgba(71, 145, 255, 0.3);
  width: 100%;
}
.oobe-btn.primary:hover { box-shadow: 0 6px 28px rgba(71, 145, 255, 0.4); }
.oobe-btn.primary:disabled { opacity: 0.5; cursor: not-allowed; }
.oobe-btn.secondary {
  background: rgba(71, 145, 255, 0.1); color: #4791ff; border: 1px solid rgba(71, 145, 255, 0.2);
}
.oobe-btn.secondary:hover { background: rgba(71, 145, 255, 0.15); }

.oobe-btn-row { display: flex; gap: 12px; }
.oobe-btn-row .oobe-btn { flex: 1; }

/* Avatars */
.oobe-avatars {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  margin-bottom: 10px;
}
.oobe-avatar-opt {
  width: 44px; height: 44px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
  border: 2px solid transparent; transition: border-color 160ms, transform 160ms;
  font-size: 22px;
}
.oobe-avatar-opt:hover { transform: scale(1.1); }
.oobe-avatar-opt.selected { border-color: #4791ff; box-shadow: 0 0 0 3px rgba(71,145,255,0.3); }

/* Complete screen */
.oobe-complete-avatar {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  border: 3px solid rgba(71, 145, 255, 0.3);
}
.oobe-summary {
  background: rgba(11, 15, 20, 0.6); border-radius: 12px; padding: 16px;
  margin: 20px 0;
}
.oobe-summary-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid rgba(71, 145, 255, 0.08);
  font-size: 14px;
}
.oobe-summary-row:last-child { border-bottom: none; }
.oobe-summary-row span:first-child { color: #7a8a9e; }
.oobe-summary-row span:last-child { color: #e6eef6; font-weight: 500; }
.oobe-secure-note {
  font-size: 12px; color: #7a8a9e; text-align: center; margin: 16px 0;
}

/* ── Login Screen ── */
.login-screen {
  position: fixed; inset: 0; z-index: 99999;
  display: none; align-items: center; justify-content: center;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #e6eef6; overflow: hidden;
}
.login-screen.active { display: flex; }
.login-screen.login-exit { animation: oobe-exit 500ms var(--easing-smooth, cubic-bezier(.22,.12,.36,1)) forwards; }

.login-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0b0f14 0%, #111827 50%, #0b0f14 100%);
}
.login-bg::after {
  content: ''; position: absolute; inset: 0;
  backdrop-filter: blur(2px);
  background: rgba(0, 0, 0, 0.3);
}

.login-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px; padding-bottom: 70px;
}
.login-fade-in { animation: oobe-fade-in 400ms var(--easing-smooth, cubic-bezier(.22,.12,.36,1)) both; }

.login-time {
  font-size: 72px; font-weight: 200; letter-spacing: -2px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.login-date {
  font-size: 16px; color: rgba(255,255,255,0.7); margin-bottom: 32px;
}

/* User list */
.login-user-list { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.login-user-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 28px; border-radius: 16px; cursor: pointer;
  background: rgba(15, 23, 32, 0.6); border: 1px solid rgba(71, 145, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: transform 160ms, border-color 160ms, background 160ms;
}
.login-user-card:hover {
  transform: translateY(-4px); border-color: rgba(71, 145, 255, 0.3);
  background: rgba(15, 23, 32, 0.8);
}
.login-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
}
.login-user-name { font-size: 15px; font-weight: 500; }
.login-user-sub { font-size: 12px; color: #7a8a9e; }

/* Password prompt */
.login-prompt { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login-avatar-lg {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 48px;
  border: 3px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  margin-bottom: 8px;
}
.login-display-name { font-size: 22px; font-weight: 500; margin-bottom: 16px; }

.login-input-wrap {
  display: flex; align-items: center; gap: 8px;
  background: rgba(15, 23, 32, 0.7); border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px; padding: 4px 4px 4px 16px;
  backdrop-filter: blur(10px);
  transition: border-color 160ms, box-shadow 160ms;
  width: 300px;
}
.login-input-wrap:focus-within {
  border-color: #4791ff; box-shadow: 0 0 0 3px rgba(71,145,255,0.15);
}
.login-input {
  background: none; border: none; color: #e6eef6; font-size: 16px;
  font-family: inherit; outline: none; flex: 1; padding: 10px 0;
}
.login-input::placeholder { color: rgba(255,255,255,0.35); }
.login-submit {
  background: linear-gradient(135deg, #4791ff, #1fd2b6); border: none;
  color: #fff; width: 40px; height: 40px; border-radius: 10px;
  font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 120ms;
}
.login-submit:hover { transform: scale(1.05); }
.login-submit:active { transform: scale(0.95); }

.login-error {
  font-size: 13px; color: #ef4444; min-height: 20px; margin-top: 4px;
}

.login-switch-btn {
  background: none; border: none; color: rgba(255,255,255,0.5);
  font-size: 13px; cursor: pointer; margin-top: 12px; font-family: inherit;
  padding: 6px 12px; border-radius: 8px;
  transition: color 160ms, background 160ms;
}
.login-switch-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Shake animation */
.login-input-wrap.shake {
  animation: login-shake 500ms cubic-bezier(.36,.07,.19,.97) both;
}

/* Login power buttons */
.login-power-row {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 16px; z-index: 2;
}
.login-power-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 160ms, color 160ms, transform 120ms;
  backdrop-filter: blur(8px);
}
.login-power-btn:hover { background: rgba(255,255,255,0.15); color: #fff; transform: scale(1.08); }
.login-power-btn:active { transform: scale(0.95); }
.login-power-btn svg { stroke-linecap: round; stroke-linejoin: round; }

/* Login password toggle */
.login-pass-toggle {
  background: none; border: none; color: rgba(255,255,255,0.35); cursor: pointer;
  padding: 4px 8px; display: flex; align-items: center; transition: color 160ms;
}
.login-pass-toggle:hover { color: rgba(255,255,255,0.7); }
.login-pass-toggle svg { stroke-linecap: round; stroke-linejoin: round; }

/* ── Boot screen override for BPE ── */
#bpe-boot-screen {
  position: fixed; inset: 0; z-index: 100001;
  background: #000; color: #0f0;
  font-family: 'Courier New', monospace; font-size: 13px;
  display: none; overflow: hidden;
}
#bpe-boot-screen.active { display: block; }

/* ── Loading screen (post-login) ── */
.loading-screen {
  position: fixed; inset: 0; z-index: 99998;
  display: none; align-items: center; justify-content: center; flex-direction: column;
  background: linear-gradient(135deg, #0b0f14 0%, #111827 100%);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #e6eef6; gap: 16px;
}
.loading-screen.active { display: flex; }
.loading-screen.loading-exit { animation: oobe-exit 600ms var(--easing-smooth, cubic-bezier(.22,.12,.36,1)) forwards; }

.loading-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  animation: loading-pulse 2s ease-in-out infinite;
}
.loading-welcome { font-size: 24px; font-weight: 500; }
.loading-sub { font-size: 14px; color: #7a8a9e; }
.loading-bar-wrap {
  width: 240px; height: 3px; background: rgba(71, 145, 255, 0.15);
  border-radius: 2px; overflow: hidden; margin-top: 8px;
}
.loading-bar {
  height: 100%; width: 0; background: linear-gradient(90deg, #4791ff, #1fd2b6);
  border-radius: 2px; transition: width 300ms ease;
}

/* ── Animations ── */
@keyframes oobe-fade-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes oobe-exit {
  to { opacity: 0; transform: scale(1.02); }
}
@keyframes login-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
@keyframes loading-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}
@keyframes so-spin {
  to { transform: rotate(360deg); }
}

/* ── Password strength bar ── */
.oobe-strength-bar {
  height: 3px; background: rgba(71,145,255,0.1); border-radius: 2px;
  overflow: hidden; margin-top: 4px;
}
.oobe-strength-fill {
  height: 100%; width: 0; border-radius: 2px;
  transition: width 200ms ease, background 200ms ease;
}

/* ── Shutdown overlay enhancements ── */
#shutdown-overlay .so-spinner { margin-bottom: 20px; }
#shutdown-overlay .so-spinner svg { animation: so-spin 1.5s linear infinite; }
#shutdown-overlay .so-sub { font-size: 12px; opacity: 0.4; margin-top: 8px; }

/* ── OOBE password toggle SVG ── */
.oobe-pass-toggle:hover { color: #e6eef6; }
.oobe-pass-toggle svg { stroke-linecap: round; stroke-linejoin: round; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .oobe-fade-in, .login-fade-in { animation: none; }
  .oobe.oobe-exit, .login-screen.login-exit, .loading-screen.loading-exit { animation: none; opacity: 0; }
  .login-input-wrap.shake { animation: none; }
  .loading-avatar { animation: none; }
}
