:root {
  --gray: #9aa0a6;
  --gray-dark: #5f6368;
  --green: #34a853;
  --red: #ea4335;
  --blue: #4285f4;
  color-scheme: light dark;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  body { background: #202124; }
  .modal { background: #2b2c30; color: #e8eaed; }
  .status-text { color: #e8eaed; }
}

.phone-btn {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray);
  transition: background-color 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.phone-btn:active {
  transform: scale(0.95);
}

.phone-icon {
  width: 40%;
  height: 40%;
  fill: #fff;
}

.phone-btn.idle { background: var(--gray); }
.phone-btn.connecting {
  background: var(--gray-dark);
  animation: pulse 1.1s ease-in-out infinite;
}
.phone-btn.registered { background: var(--green); }
.phone-btn.calling {
  background: var(--blue);
  animation: pulse 0.9s ease-in-out infinite;
}
.phone-btn.in-call { background: var(--blue); }
.phone-btn.failed { background: var(--red); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.25); }
  50% { box-shadow: 0 0 0 14px rgba(0, 0, 0, 0); }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 40px 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 220px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
}

.modal-close:hover {
  opacity: 1;
}

.status-text {
  margin: 0;
  font-size: 14px;
  color: var(--gray-dark);
  text-align: center;
}
