/* ============================================================================
   VelvetOS — session layer: boot, OOBE, login, lock, shutdown, updates
   ========================================================================== */

.session-layer {
  position: fixed; inset: 0; z-index: var(--z-session);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.session-layer[hidden] { display: none !important; }
.session {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--login-text);
  background: var(--login-bg);
  animation: fade-in var(--dur-l) var(--ease-standard);
}
.session.closing { animation: fade-out var(--dur-l) var(--ease-accelerate) forwards; }
.session-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.session-scrim {
  position: absolute; inset: 0;
  backdrop-filter: blur(22px) brightness(.72) saturate(1.2);
}

/* ============================== BOOT ==================================== */
.boot {
  background: #0c0d10; color: #e8eaed;
  gap: var(--sp-6);
}
.boot-logo { display: flex; flex-direction: column; align-items: center; gap: var(--sp-5); }
.boot-mark {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  color: #ffffff;
  animation: boot-mark-in 700ms var(--ease-decelerate) both;
}
.boot-mark svg { width: 72px; height: 72px; }
@keyframes boot-mark-in { from { opacity: 0; transform: scale(.94); } }
.boot-name {
  font-family: var(--font-display); font-size: 15px; letter-spacing: 7px;
  text-transform: uppercase; font-weight: var(--fw-regular); color: #e8eaed;
  opacity: .92; animation: fade-in 900ms 200ms both;
}
.boot-progress {
  width: 208px; height: 2px; border-radius: 2px; background: rgba(255,255,255,.14);
  overflow: hidden; animation: fade-in 700ms 450ms both;
}
.boot-progress > span {
  display: block; height: 100%; width: 0%; background: #ffffff; border-radius: 2px;
  transition: width var(--dur-l) var(--ease-standard);
}
.boot-status {
  font-size: var(--fs-caption); color: #80868b; min-height: 16px; letter-spacing: .2px;
  animation: fade-in 700ms 600ms both; text-align: center;
}
.boot-meta {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: #4f5357; letter-spacing: .4px;
  animation: fade-in 900ms 800ms both;
}
.boot-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18); border-top-color: var(--accent);
  animation: spin 900ms linear infinite;
}
.boot-keys { display: flex; gap: var(--sp-3); font-size: var(--fs-caption); color: #5f6368; }

/* recovery / firmware style screens */
.boot.alt { background: #000; }
.recovery {
  max-width: 560px; text-align: left; color: #e8eaed; padding: var(--sp-8);
  font-size: var(--fs-body); line-height: 1.7;
}
.recovery h2 { font-size: 20px; margin-bottom: var(--sp-4); font-weight: var(--fw-regular); }
.recovery code { background: rgba(255,255,255,.1); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); }

/* ============================== LOGIN =================================== */
.login { gap: 0; justify-content: center; }
.login-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-6); padding-bottom: 40px; }
.login-clock { text-align: center; margin-bottom: var(--sp-4); }
.login-time {
  font-family: var(--font-display); font-size: 64px; font-weight: var(--fw-regular);
  line-height: 1; letter-spacing: -1px; color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.login-date { font-size: var(--fs-title); color: rgba(255,255,255,.9); margin-top: var(--sp-2); text-shadow: 0 1px 12px rgba(0,0,0,.4); }

.login-cards { display: flex; gap: var(--sp-6); align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.login-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-5) var(--sp-6); border-radius: var(--r-l);
  cursor: pointer; min-width: 168px; border: 0; background: transparent;
  transition: background var(--dur-m) var(--ease-standard), transform var(--dur-m) var(--ease-standard);
}
.login-card:hover { background: rgba(255,255,255,.14); }
.login-card.selected { background: rgba(255,255,255,.22); }
.login-card .avatar { width: 84px; height: 84px; font-size: 32px; box-shadow: 0 6px 20px rgba(0,0,0,.28); }
.login-card .lc-name { font-size: var(--fs-title); color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.login-card .lc-sub { font-size: var(--fs-caption); color: rgba(255,255,255,.75); }
.login-card.add-user .avatar { background: rgba(255,255,255,.2); color: #fff; }

.login-password {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  width: min(340px, 86vw);
}
.login-password .field {
  width: 100%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3);
  height: 44px; border-radius: var(--r-full); color: #fff;
}
.login-password .field input { color: #fff; }
.login-password .field input::placeholder { color: rgba(255,255,255,.6); }
.login-password .field .icon { color: rgba(255,255,255,.8); }
.login-password .field:focus-within { border-color: #fff; box-shadow: none; background: rgba(255,255,255,.24); }
.login-error { color: #ffd9d5; font-size: var(--fs-label); }

.login-tray {
  position: absolute; right: 18px; bottom: 18px;
  display: flex; align-items: center; gap: var(--sp-2);
}
.login-tray .icon-btn { color: rgba(255,255,255,.9); }
.login-tray .icon-btn:hover { background: rgba(255,255,255,.18); }
.login-hint {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: var(--sp-2); padding: 8px 16px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
  font-size: var(--fs-caption); color: rgba(255, 255, 255, .9);
  text-align: center; max-width: 440px;
}
[data-theme="dark"] .login-hint { background: rgba(255,255,255,.1); }

/* ============================== LOCK ==================================== */
.lock .login-time { font-size: 72px; }

/* ============================== POWER / SHUTDOWN ======================== */
.shutdown { background: #000; color: #e8eaed; gap: var(--sp-6); }
.shutdown .sd-text { font-size: var(--fs-title); letter-spacing: .3px; }
.shutdown .sd-sub { font-size: var(--fs-label); color: #80868b; }
.power-off { background: #000; }
.power-btn-big {
  width: 68px; height: 68px; border-radius: 50%; border: 1px solid #5f6368;
  background: transparent; color: #e8eaed; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-m), border-color var(--dur-m);
}
.power-btn-big:hover { background: rgba(255,255,255,.1); border-color: #e8eaed; }
.power-btn-big .icon { width: 30px; height: 30px; }

/* ============================== OOBE ==================================== */
.oobe { background: var(--surface); color: var(--on-surface); justify-content: stretch; }
.oobe-wrap {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column;
}
.oobe-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 14px 20px; border-bottom: 1px solid var(--divider); flex: none;
}
.oobe-head .boot-mark { width: 30px; height: 30px; border-radius: 8px; box-shadow: none; animation: none; color: #fff; }
.oobe-head .boot-mark svg { width: 26px; height: 26px; }
.oobe-head .oh-name { font-size: var(--fs-label); font-weight: var(--fw-medium); letter-spacing: 4px; text-transform: uppercase; }
.oobe-steps { display: flex; gap: 6px; margin-left: auto; }
.oobe-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-4); }
.oobe-dot.active { background: var(--primary); width: 18px; border-radius: 3px; }
.oobe-body {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8); overflow-y: auto;
}
.oobe-panel { width: min(620px, 100%); animation: fade-in var(--dur-l) var(--ease-standard); }
.oobe-title { font-family: var(--font-display); font-size: var(--fs-headline); font-weight: var(--fw-regular); margin-bottom: var(--sp-2); }
.oobe-sub { color: var(--on-surface-3); margin-bottom: var(--sp-6); font-size: 14px; line-height: 1.6; }
.oobe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-3); }
.oobe-choice {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 14px; border: 1px solid var(--outline); border-radius: var(--r-m);
  background: var(--surface); cursor: pointer; text-align: left;
  transition: border-color var(--dur-s), background var(--dur-s), box-shadow var(--dur-s);
}
.oobe-choice:hover { background: var(--surface-2); }
.oobe-choice.selected { border-color: var(--primary); background: var(--primary-container); }
.oobe-choice .oc-text { flex: 1 1 auto; min-width: 0; }
.oobe-choice .oc-title { font-size: var(--fs-body); }
.oobe-choice .oc-sub { font-size: var(--fs-caption); color: var(--on-surface-3); }
.oobe-langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--sp-2); }
.oobe-net-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.oobe-avatar-picker { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.oobe-avatar-picker .avatar { cursor: pointer; width: 52px; height: 52px; font-size: 20px; border: 3px solid transparent; }
.oobe-avatar-picker .avatar.selected { border-color: var(--primary); }
.oobe-theme-picker { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.oobe-theme-card {
  width: 168px; border-radius: var(--r-l); overflow: hidden; cursor: pointer;
  border: 2px solid transparent; box-shadow: var(--elevation-1);
}
.oobe-theme-card.selected { border-color: var(--primary); }
.oobe-theme-card .otc-preview { height: 96px; background-size: cover; background-position: center; }
.oobe-theme-card .otc-label { padding: 8px 10px; font-size: var(--fs-label); background: var(--surface); }
.oobe-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 14px 20px; border-top: 1px solid var(--divider); flex: none;
}
.oobe-terms { font-size: var(--fs-label); color: var(--on-surface-3); line-height: 1.7; max-height: 320px; overflow-y: auto; }
.oobe-progress { width: 100%; }

/* ============================== WELCOME / TIPS ========================= */
.session-loading { gap: var(--sp-5); background: var(--surface); color: var(--on-surface); }
.session-loading .spinner { width: 34px; height: 34px; }
