/* ---------- Loading screen ---------- */
.boot-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: var(--bg);
  z-index: 999;
}

.boot-mark {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: var(--text-primary);
}
.boot-mark span { color: var(--accent); }

.boot-spinner {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.boot-status {
  font-size: 13px;
  color: var(--text-tertiary);
  min-height: 16px;
}

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

.boot-screen.leaving {
  animation: boot-fade 0.5s var(--ease) forwards;
}
@keyframes boot-fade {
  to { opacity: 0; visibility: hidden; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--r-sm);
  font-size: 15px;
  font-weight: 700;
  background: var(--surface-raised);
  color: var(--text-primary);
  transition: background 0.15s var(--ease), transform 0.1s var(--ease);
  border: 1px solid var(--border);
}
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #1a1305;
  border: none;
}
.btn-primary:hover { background: #f0bd63; }

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(241, 96, 99, 0.3);
}

.btn-block { width: 100%; }

.btn-icon {
  width: 48px; height: 48px;
  padding: 0;
  border-radius: var(--r-pill);
  font-size: 20px;
}
.btn-icon.active { background: var(--danger-soft); border-color: rgba(241,96,99,0.3); }

/* ---------- Inputs ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; text-align: left; }
.field label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}
.field input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 13px 14px;
  font-size: 15px;
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease);
}
.field input:focus {
  border-color: var(--accent);
  outline: none;
}

/* ---------- Auth screens ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(232, 179, 77, 0.08), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 40px 32px;
  text-align: center;
  animation: rise 0.5s var(--ease);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 4px;
}
.auth-brand span { color: var(--accent); }

.auth-sub {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.auth-switch {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.auth-switch button {
  background: none;
  color: var(--accent);
  font-weight: 700;
  padding: 0;
}

.error-banner {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(241, 96, 99, 0.3);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  text-align: left;
  margin-bottom: 18px;
  line-height: 1.4;
}

.hint-banner {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(232, 179, 77, 0.3);
  border-radius: var(--r-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  text-align: left;
  margin-bottom: 18px;
  line-height: 1.4;
}

.spinner-sm {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: currentColor;
  animation: spin 0.7s linear infinite;
}

/* ---------- Generic app chrome ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
}

.topbar-brand {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.03em;
}
.topbar-brand span { color: var(--accent); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: var(--r-pill);
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-tertiary);
}
.status-dot.on { background: var(--success); box-shadow: 0 0 8px rgba(74,222,128,0.6); }
.status-dot.off { background: var(--danger); }

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 32px;
}
.error-page h2 { margin: 0; font-size: 20px; }
.error-page p { color: var(--text-secondary); max-width: 340px; margin: 0; }

/* toast */
#toast-root {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 11px 18px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  animation: toast-in 0.25s var(--ease);
}
.toast.error { border-color: rgba(241,96,99,0.4); color: #ffb3b4; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Update dialog (Tauri desktop only) ---------- */
.update-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 12, 17, 0.72);
  backdrop-filter: blur(4px);
  animation: toast-in 0.2s var(--ease);
}
.update-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 28px;
  text-align: center;
}
.update-brand {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin-bottom: 14px;
}
.update-brand span { color: var(--accent); }
.update-title { font-size: 19px; margin: 0 0 6px; }
.update-sub { color: var(--text-secondary); font-size: 14px; margin: 0 0 22px; }
.update-actions { display: flex; gap: 10px; }
.update-actions .btn { flex: 1; }
.update-progress { margin-bottom: 22px; }
.update-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.update-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s var(--ease);
}
.update-progress-pct { font-size: 12.5px; color: var(--text-tertiary); }
.update-error { color: var(--danger); font-size: 13px; margin: 14px 0 0; }
