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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

.app {
  width: 100%;
  max-width: 400px;
  background: #16213e;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

header {
  background: #0f3460;
  padding: 20px;
  text-align: center;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #e94560;
  margin-bottom: 12px;
}

.status-bar {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.status {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.status.disconnected {
  background: rgba(255, 69, 58, 0.2);
  color: #ff453a;
}

.status.connected {
  background: rgba(48, 209, 88, 0.2);
  color: #30d158;
}

.status.connecting {
  background: rgba(255, 214, 10, 0.2);
  color: #ffd60a;
}

main {
  padding: 20px;
}

/* Provider selector */
.provider-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.provider-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #0f3460;
  background: transparent;
  color: #8899aa;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.provider-btn.active {
  border-color: #e94560;
  color: #e94560;
  background: rgba(233, 69, 96, 0.1);
}

.provider-btn:hover {
  border-color: #e94560;
}

/* Display */
.display {
  margin-bottom: 20px;
}

#phone-number {
  width: 100%;
  padding: 14px;
  background: #0f3460;
  border: 1px solid #1a4080;
  border-radius: 10px;
  color: #fff;
  font-size: 1.3rem;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
}

#phone-number::placeholder {
  color: #556677;
  font-size: 0.9rem;
  letter-spacing: 0;
}

#phone-number:focus {
  border-color: #e94560;
}

/* Dialpad */
.dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.key {
  aspect-ratio: 1.5;
  border: none;
  background: #0f3460;
  color: #fff;
  font-size: 1.4rem;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  user-select: none;
}

.key span {
  font-size: 0.55rem;
  color: #8899aa;
  letter-spacing: 2px;
  margin-top: 2px;
}

.key:hover {
  background: #1a4080;
}

.key:active {
  background: #e94560;
  transform: scale(0.95);
}

/* Call controls */
.call-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.call-btn,
.hangup-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.call-btn {
  background: #30d158;
  color: #fff;
}

.call-btn:hover {
  background: #28b84c;
}

.call-btn:disabled {
  background: #1a4040;
  color: #556;
  cursor: not-allowed;
}

.hangup-btn {
  background: #ff453a;
  color: #fff;
}

.hangup-btn:hover {
  background: #e03e34;
}

.hangup-btn:disabled {
  background: #401a1a;
  color: #556;
  cursor: not-allowed;
}

/* In-call controls */
.in-call-controls {
  margin-bottom: 20px;
  text-align: center;
}

.in-call-controls.hidden {
  display: none;
}

.call-timer {
  font-size: 1.8rem;
  font-weight: 300;
  color: #30d158;
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}

.call-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.action-btn {
  padding: 8px 18px;
  border: 1px solid #0f3460;
  background: transparent;
  color: #8899aa;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: #e94560;
  color: #e94560;
}

.action-btn.active {
  background: rgba(233, 69, 96, 0.2);
  border-color: #e94560;
  color: #e94560;
}

/* Call log */
.call-log {
  border-top: 1px solid #0f3460;
  padding-top: 16px;
}

.call-log h3 {
  font-size: 0.85rem;
  color: #8899aa;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#call-log-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}

#call-log-list li {
  padding: 8px 12px;
  background: #0f3460;
  border-radius: 6px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

#call-log-list li .log-number {
  color: #e0e0e0;
}

#call-log-list li .log-meta {
  color: #8899aa;
  font-size: 0.75rem;
}

#call-log-list li .log-provider {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(233, 69, 96, 0.15);
  color: #e94560;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #0f3460;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 440px) {
  body {
    padding: 0;
  }
  .app {
    border-radius: 0;
    min-height: 100vh;
  }
}
