/* Wanos — account screens: sign in, My Macs, linking a Mac.
   Built like the macOS login window and a Finder-style window on the desktop
   wallpaper, with the same Liquid Glass material as the rest of Wanos. */

.account {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: #080913;
  overflow-y: auto;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}

/* Soft vignette so glass panels read well on any part of the wallpaper */
.account::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
  pointer-events: none;
}

/* ---------- Clock, as on the macOS lock screen ---------- */
.account-clock {
  position: relative;
  text-align: center;
  margin-bottom: 56px;
  display: none;
}

.account.with-clock .account-clock {
  display: block;
}

.account-date {
  font-size: 20px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.25);
}

.account-time {
  font-family: var(--font-rounded);
  font-size: clamp(96px, 16vw, 168px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -2px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.25);
  font-variant-numeric: tabular-nums;
}

.account-stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.account-stage.enter > * {
  animation: account-in 0.45s var(--ease-spring) both;
}

@keyframes account-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}


/* Flowing light ribbons behind every account screen (account.js createWaves) */
.account-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.account-clock,
.account-stage {
  z-index: 1;
}

/* ---------- Sign in ---------- */
.login {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-tagline {
  width: max-content;
  max-width: 92vw;
  margin: 0 0 36px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.2px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.login-card {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sso-btn {
  position: relative;
  height: 46px;
  border-radius: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s var(--ease-spring), filter 0.15s;
}

.sso-btn:active {
  transform: scale(0.97);
}

.sso-btn svg {
  width: 18px;
  height: 18px;
}

/* Apple's guidelines: white on dark backgrounds, black logo and text */
.sso-apple {
  background: #fff;
  color: #000;
}

.sso-apple svg {
  width: 16px;
  height: 19px;
  margin-top: -3px;
}

/* Google's guidelines: neutral fill, standard G mark, Roboto-like weight */
.sso-google {
  background: #131314;
  color: #e3e3e3;
  box-shadow: inset 0 0 0 1px #8e918f;
  font-weight: 500;
}

.sso-btn.busy {
  pointer-events: none;
  filter: brightness(0.85);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  font-size: 12px;
  color: var(--label-tertiary);
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.link-btn {
  height: 36px;
  font-size: 14px;
  font-weight: 500;
  color: #69b1ff;
}

.login-note {
  font-size: 14px;
  line-height: 1.45;
  color: var(--label-secondary);
}

.login-fineprint {
  max-width: 300px;
  margin-top: 40px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}

.dev-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dev-login input,
.text-field {
  height: 42px;
  padding: 0 16px;
  border-radius: 21px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 15px;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}

.dev-login input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.3);
}

/* ---------- Buttons ---------- */
.pill-btn {
  min-width: 96px;
  height: 36px;
  padding: 0 18px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.15s var(--ease-spring), background 0.15s;
}

.pill-btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 4px 14px rgba(10, 132, 255, 0.35);
}

.pill-btn:active {
  transform: scale(0.96);
}

.pill-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Window (My Macs) ---------- */
.window {
  width: 100%;
  max-width: 760px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100dvh - 48px);
}

.window-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px 22px;
}

.window-title h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.window-subtitle {
  font-size: 12px;
  color: var(--label-secondary);
}

.window-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--label-secondary);
  transition: background 0.15s;
}

.tool-btn:active {
  background: var(--hover-fill);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #8e8e93, #5a5a60);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.3);
  flex: 0 0 auto;
}

.avatar.large {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.window-body {
  padding: 4px 16px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}

/* Finder-style icon tile: artwork, name, status */
.mac-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 10px 14px;
  border-radius: 18px;
  text-align: center;
  transition: background 0.18s, transform 0.18s var(--ease-spring);
}

.mac-card:active {
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.1);
}

@media (hover: hover) {
  .mac-card:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

.mac-art {
  position: relative;
  width: 120px;
  height: 88px;
  margin-bottom: 6px;
}

.mac-glyph {
  width: 120px;
  height: 88px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
  transition: filter 0.2s, opacity 0.2s;
}

.mac-card.offline .mac-glyph {
  filter: grayscale(1) brightness(0.75) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.25));
  opacity: 0.6;
}

.mac-name {
  max-width: 100%;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-card.offline .mac-name {
  color: var(--label-secondary);
}

.mac-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--label-secondary);
}

.mac-status i {
  display: inline-flex;
}

.mac-status i:empty {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--label-tertiary);
}

.mac-card.online .mac-status i:empty {
  background: var(--green);
  box-shadow: 0 0 6px rgba(48, 209, 88, 0.7);
}

.mac-card.busy .mac-status i:empty {
  background: var(--accent);
}

.mac-card.locked .mac-status {
  color: var(--orange);
}

.mac-status i svg {
  width: 10px;
  height: 12px;
}

/* Connecting: dim the artwork and spin over its screen */
.mac-spinner {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  opacity: 0;
  animation: spin 0.8s linear infinite;
}

.mac-card.connecting .mac-spinner,
.mac-spinner.visible {
  opacity: 1;
}

.mac-card.connecting .mac-glyph {
  filter: brightness(0.7) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.account-loading {
  position: relative;
  height: 60px;
}

.account-loading .mac-spinner {
  top: 0;
}

.window-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px 0 8px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #69b1ff;
}

.footer-btn:active {
  background: var(--hover-fill);
}

.footer-hint {
  font-size: 12px;
  color: var(--label-tertiary);
}

/* ---------- Steps (empty state, Add a Mac, QR help) ---------- */
/* ---------- Welcome (no Macs yet) and the Add a Mac guide ---------- */
.welcome {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.welcome-top {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 24px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.welcome-brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: rgba(255, 255, 255, 0.9);
}

.add-guide {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.signin-art {
  width: min(400px, 80vw);
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.35));
}

.signin-cursor {
  animation: cursor-tap 2.4s ease-in-out infinite;
  transform-box: fill-box;
}

@keyframes cursor-tap {
  0%, 60%, 100% { transform: translate(0, 0); }
  70% { transform: translate(-1px, 1px) scale(0.92); }
}

.welcome-guide h1 {
  margin-top: 44px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.6px;
}

.guide-line {
  max-width: 420px;
  margin-top: 12px;
  font-size: 17px;
  line-height: 1.45;
  color: var(--label-secondary);
}

.guide-line b {
  white-space: nowrap;
  font-weight: 600;
  color: var(--label);
}

.welcome-waiting {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 48px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.welcome-waiting i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #30d158;
  animation: waiting-pulse 1.6s ease-in-out infinite;
}

@keyframes waiting-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* Inside the Add a Mac sheet */
.add-guide:not(.welcome-guide) .signin-art { width: min(300px, 70vw); margin-top: 6px; }
.add-guide:not(.welcome-guide) .guide-line { margin-top: 18px; font-size: 15px; }

/* The welcome page has a fixed top bar, so it fades in without moving */
.account-stage.enter > .welcome {
  animation-name: welcome-in;
}

@keyframes welcome-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Connecting to a Mac ---------- */
.connect {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.account-stage.enter > .connect { animation-name: welcome-in; }

.connect-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 240px;
  height: 176px;
}

.connect-art .mac-glyph {
  position: relative;
  width: 240px;
  height: 176px;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.45));
  transition: filter 0.4s, opacity 0.4s;
}

/* Rings that leave the Mac, like the signal it sends to the iPad */
.connect-wave {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  border: 1.5px solid rgba(105, 177, 255, 0.55);
  opacity: 0;
  animation: connect-wave 2.7s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.connect-wave:nth-child(2) { animation-delay: 0.9s; }
.connect-wave:nth-child(3) { animation-delay: 1.8s; }

@keyframes connect-wave {
  0% { opacity: 0.9; transform: scale(0.55); }
  100% { opacity: 0; transform: scale(2.1); }
}

.connect h1 {
  margin-top: 36px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.connect-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 16px;
  color: var(--label-secondary);
}

.connect-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0a84ff;
  animation: waiting-pulse 1.2s ease-in-out infinite;
}

.connect-switch { margin-top: 40px; }

/* Asleep: the Mac dims, the rings slow down and fade */
.connect.waiting .mac-glyph {
  filter: grayscale(0.9) brightness(0.5) drop-shadow(0 22px 34px rgba(0, 0, 0, 0.35));
}
.connect.waiting .connect-wave {
  border-color: rgba(255, 255, 255, 0.22);
  animation-duration: 5.4s;
}
.connect.waiting .connect-wave:nth-child(2) { animation-delay: 1.8s; }
.connect.waiting .connect-wave:nth-child(3) { animation-delay: 3.6s; }
.connect.waiting .connect-status i {
  background: #ff9f0a;
  animation-duration: 2.4s;
}

@media (prefers-reduced-motion: reduce) {
  .connect-wave { animation: none; }
}

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  max-width: 420px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--label);
}

.steps li span {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.14);
}

/* ---------- Sheets (Add a Mac, link this Mac) ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  animation: fade-in 0.2s ease both;
}

.sheet-backdrop .sheet {
  animation: account-in 0.4s var(--ease-spring) both;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.sheet {
  width: 100%;
  max-width: 440px;
  padding: 26px 26px 22px;
  border-radius: 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.add-sheet {
  max-width: 440px;
  align-items: center;
  text-align: center;
}

.add-sheet .sheet-buttons {
  align-self: stretch;
}

.sheet h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.sheet-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--label-secondary);
}

.sheet-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.link-card {
  align-items: center;
  text-align: center;
  max-width: 400px;
}

.link-card .sheet-buttons {
  width: 100%;
  justify-content: center;
}

.link-art .mac-glyph {
  width: 150px;
  height: 110px;
}

.link-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 4px;
  padding: 10px 22px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.link-hint {
  margin-top: -4px;
  font-size: 13px;
  color: var(--label-secondary);
}

.done-check svg {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 8px 20px rgba(48, 209, 88, 0.4));
  animation: pop 0.5s var(--ease-spring) both;
}

@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
}

/* ---------- Account menu ---------- */
.account-menu {
  position: fixed;
  z-index: 20;
  width: 280px;
  padding: 8px;
  border-radius: 18px;
  animation: account-in 0.25s var(--ease-spring) both;
}

.account-menu-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 12px;
}

.account-menu-name {
  font-size: 15px;
  font-weight: 600;
}

.account-menu-email {
  font-size: 12px;
  color: var(--label-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
  white-space: nowrap;
}

.account-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 10px;
  font-size: 13px;
  color: var(--label-secondary);
}

.plan-badge {
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
}

.plan-badge.pro {
  background: linear-gradient(135deg, #5e5ce6, #bf5af2);
}

.account-menu .menu-sep {
  height: 1px;
  margin: 2px 8px 6px;
  background: rgba(255, 255, 255, 0.14);
}

.account-menu-item {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  text-align: left;
  font-size: 14px;
}

.account-menu-item:active {
  background: var(--accent);
}

.account-menu-item.danger {
  color: #ff6961;
}

/* ---------- Toast ---------- */
.account-toast {
  position: fixed;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 30;
  max-width: calc(100vw - 32px);
  padding: 11px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: rgba(30, 32, 42, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
  transform: translate(-50%, 20px);
  opacity: 0;
  transition: opacity 0.25s, transform 0.3s var(--ease-spring);
}

.account-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 520px) {
  .mac-grid { grid-template-columns: repeat(2, 1fr); }
  .mac-art, .mac-glyph { width: 100px; height: 74px; }
  .mac-spinner { top: 20px; }
}

/* Short screens (iPad in landscape with the keyboard, small windows) */
@media (max-height: 760px) {
  .account.with-clock .account-clock { margin-bottom: 28px; }
  .login-tagline { margin-bottom: 22px; }
  .login-fineprint { margin-top: 22px; }
  .account-time { font-size: 84px; }
}
