:root {
  --bg-0: #0a0c10;
  --bg-1: #10131a;
  --card: #131720;
  --card-border: rgba(255, 255, 255, 0.08);
  --text-0: #f4f6fa;
  --text-1: #9aa3b2;
  --text-2: #5c6472;
  --accent: #5b8cff;
  --accent-glow: rgba(91, 140, 255, 0.35);
  --green: #35d399;
  --green-glow: rgba(53, 211, 153, 0.35);
  --red: #6b7280;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-0);
  color: var(--text-0);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.backdrop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(91, 140, 255, 0.12), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(53, 211, 153, 0.10), transparent 45%),
    var(--bg-1);
  z-index: -1;
}

.card {
  width: min(92vw, 380px);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  background-color: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: 40px 32px 32px;
  text-align: center;
  box-shadow:
    0 20px 60px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  backdrop-filter: blur(20px);
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 28px;
}

.orb-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.06), rgba(255,255,255,0.01));
  border: 1px solid var(--card-border);
  transition: color 0.5s ease, box-shadow 0.6s ease, border-color 0.5s ease;
}

.orb-icon {
  width: 36px;
  height: 36px;
}

.orb.online {
  color: var(--green);
  border-color: rgba(53, 211, 153, 0.35);
  box-shadow: 0 0 0 0 var(--green-glow);
  animation: pulse-green 2.4s ease-out infinite;
}

.orb.waking {
  color: var(--accent);
  border-color: rgba(91, 140, 255, 0.35);
  animation: pulse-blue 1.3s ease-out infinite;
}

@keyframes pulse-green {
  0%   { box-shadow: 0 0 0 0 var(--green-glow); }
  70%  { box-shadow: 0 0 0 16px rgba(53, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 211, 153, 0); }
}

@keyframes pulse-blue {
  0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
  70%  { box-shadow: 0 0 0 14px rgba(91, 140, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 140, 255, 0); }
}

h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  transition: color 0.4s ease;
}

.subtext {
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 28px;
}

.password-input {
  width: 100%;
  padding: 13px 16px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-0);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease;
}

.password-input:focus {
  border-color: rgba(91, 140, 255, 0.5);
}

.wake-btn {
  position: relative;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: white;
  background: linear-gradient(180deg, #6f9bff, #4c78ef);
  cursor: pointer;
  box-shadow: 0 8px 24px -8px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

.wake-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -6px var(--accent-glow);
}

.wake-btn:active:not(:disabled) {
  transform: translateY(0);
}

.wake-btn:disabled {
  cursor: default;
  opacity: 0.55;
  box-shadow: none;
}

.wake-btn.already-on {
  background: linear-gradient(180deg, #2a2f3a, #1c2028);
  opacity: 1;
}

.wake-btn .spinner {
  display: none;
  position: absolute;
  right: 18px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}

.wake-btn.loading .spinner {
  display: inline-block;
}

.wake-btn.loading .btn-label {
  opacity: 0.7;
}

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

.shutdown-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px 20px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 550;
  color: var(--text-1);
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.shutdown-btn:hover:not(:disabled) {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.06);
}

.shutdown-btn.confirm {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.08);
}

.shutdown-btn:disabled {
  cursor: default;
  opacity: 0.4;
}

.toast {
  height: 18px;
  font-size: 13px;
  color: var(--green);
  margin-top: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.toast.show {
  opacity: 1;
}

footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

footer span {
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-2);
  font-family: "SF Mono", "Menlo", monospace;
}

.logout-link {
  font-size: 12px;
  color: var(--text-2);
  text-decoration: none;
}

.logout-link:hover {
  color: var(--text-1);
  text-decoration: underline;
}
