/* Pulu web: components shared by the remote (/app) and the admin panel (/admin):
   dots, chips, icon and link buttons, spinner, form fields, the sign-in screen, toasts. */

.ico { width: 20px; height: 20px; flex: none; }


.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot--on { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }

.chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.chip--queued { background: rgba(255, 255, 255, 0.07); color: #b9bdc5; }
.chip--running { background: rgba(110, 155, 255, 0.15); color: #9dbbff; }
.chip--done, .chip--allowed { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; }
.chip--error, .chip--denied { background: rgba(255, 95, 100, 0.14); color: #ff9a9d; }
.chip--cancelled, .chip--expired { background: rgba(255, 255, 255, 0.06); color: var(--text-3); }
.chip--kind-read { background: rgba(110, 198, 255, 0.14); color: #8fd3ff; }
.chip--kind-act { background: rgba(255, 180, 61, 0.15); color: #ffc46b; }
.chip--kind-sensitive { background: rgba(255, 95, 100, 0.15); color: #ff9a9d; }
.chip--kind-tool { background: rgba(161, 132, 255, 0.16); color: #c4b5ff; }
.chip--kind-agent { background: rgba(30, 196, 180, 0.15); color: #6fe3d6; }
.chip--kind-other { background: rgba(255, 255, 255, 0.07); color: var(--text-2); }

.tag { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag--muted { background: rgba(255, 180, 61, 0.12); color: #ffc46b; }

.iconbtn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  -webkit-tap-highlight-color: transparent;
}
.iconbtn:hover { background: var(--hover); color: var(--text); }

.linkbtn {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--text); }
.linkbtn[disabled] { opacity: 0.5; cursor: default; text-decoration: none; }

.spinner {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */

.login {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: calc(24px + env(safe-area-inset-top)) var(--gutter) calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(420px 280px at 30% 0%, rgba(110, 155, 255, 0.16), transparent 70%),
    radial-gradient(420px 300px at 80% 10%, rgba(161, 132, 255, 0.14), transparent 70%);
}
.login__card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: rgba(20, 21, 24, 0.86);
  text-align: center;
}
.login__ghost { margin-bottom: 14px; animation: ghost-float 5s ease-in-out infinite; }
.login__ghost .ghost__eye { animation: ghost-blink 4.6s infinite; }
.login__title { font: 700 26px/1.15 var(--font-display); letter-spacing: -0.025em; }
.login__subtitle { margin-top: 6px; color: var(--text-2); font-size: 15px; }
.login__form { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 22px; text-align: left; }
.login__form[hidden] { display: none; }
.field__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 16px; /* 16 px: iOS does not zoom in */
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field__input:focus { border-color: rgba(161, 132, 255, 0.7); box-shadow: 0 0 0 4px rgba(161, 132, 255, 0.15); }
.field__input--code { text-align: center; font: 600 22px/1 var(--mono); letter-spacing: 0.3em; }
.login__sent { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: rgba(110, 155, 255, 0.08); border: 1px solid rgba(110, 155, 255, 0.2); }
.login__sent-icon { color: #9dbbff; }
.login__sent-title { font-weight: 600; font-size: 15px; }
.login__sent-text { margin-top: 2px; color: var(--text-2); font-size: 14px; overflow-wrap: anywhere; }
.login__sent-text strong { color: var(--text); font-weight: 600; }
.login__links { display: flex; justify-content: space-between; gap: 12px; }
.login__status { min-height: 20px; margin-top: 12px; color: var(--text-2); font-size: 14px; }
.login__status--error { color: #ff9a9d; }
.login__status--ok { color: #6ee7b7; }
/* Pairing code (the remote's main sign-in) */
.field__input--pair {
  height: 58px;
  text-align: center;
  font: 600 26px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.field__input--pair::placeholder { color: var(--text-3); opacity: 0.6; }
.login__hint { color: var(--text-2); font-size: 13.5px; line-height: 1.45; text-align: center; }
.login__hint strong { color: var(--text); font-weight: 600; white-space: nowrap; }
.login__or {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 18px 0 14px;
  color: var(--text-3);
  font-size: 13px;
}
.login__or::before, .login__or::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.login__alt { width: 100%; }
.login__back { margin-top: 14px; }
.login__foot { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login__tip { color: var(--text-3); font-size: 13px; }
.login__home { color: var(--text-3); font-size: 13px; text-underline-offset: 3px; }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(72px + env(safe-area-inset-top));
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 var(--gutter);
  pointer-events: none;
}
.toast {
  max-width: 440px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(34, 37, 42, 0.96);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast--error { border-color: rgba(255, 95, 100, 0.4); color: #ffc0c2; }
.toast--ok { border-color: rgba(52, 211, 153, 0.35); }

/* Generic chip tones (admin panel) */
.chip--good { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; }
.chip--warn { background: rgba(255, 180, 61, 0.15); color: #ffc46b; }
.chip--bad { background: rgba(255, 95, 100, 0.15); color: #ff9a9d; }
.chip--info { background: rgba(110, 155, 255, 0.15); color: #9dbbff; }
.chip--muted { background: rgba(255, 255, 255, 0.06); color: var(--text-2); }
.chip--accent { background: rgba(161, 132, 255, 0.18); color: #c9bbff; }

.btn--danger-solid { background: var(--red); color: #fff; }
.btn--danger-solid:hover { background: #ff7479; }
