:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --text: #eef0f3;
  --muted: #8b8fa3;
  --accent: #4caf7d;
  --danger: #e2574c;
  --border: #2a2e38;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.screen {
  width: 100%;
  max-width: 380px;
}

h1 {
  text-align: center;
  font-weight: 600;
  margin-bottom: 24px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

input {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

button {
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

#login-form button[type="submit"] {
  background: var(--accent);
  color: #06140c;
  margin-top: 4px;
}

.error {
  color: var(--danger);
  font-size: 14px;
  margin: 0;
  text-align: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
}

#me-label {
  color: var(--muted);
  font-size: 14px;
}

.link-btn {
  background: none;
  color: var(--muted);
  font-weight: 400;
  font-size: 14px;
  padding: 6px;
}

.status-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 56px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.2s;
}

.dot.online { background: var(--accent); }
.dot.ringing { background: #e2b14c; animation: pulse 1s infinite; }
.dot.active { background: var(--accent); animation: pulse 1.4s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

#status-text {
  font-size: 18px;
  color: var(--muted);
  text-align: center;
}

.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.round-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.round-btn .icon { display: block; }
.icon-hangup { transform: rotate(135deg); }

.call-btn { background: var(--accent); color: #06140c; }
.hangup-btn { background: var(--danger); color: #1a0806; }
.call-btn:disabled, .hangup-btn:disabled { opacity: 0.4; cursor: default; }

.incoming-actions {
  display: flex;
  gap: 24px;
}

.pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  margin-top: 8px;
}

.pill-btn.on {
  color: var(--accent);
  border-color: var(--accent);
}

[hidden] { display: none !important; }

/* kept in the render tree (not display:none) so iOS doesn't stop its audio */
.offscreen-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
