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

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Segoe UI', sans-serif;
}

#widget {
  background: #16213e;
  border-radius: 16px;
  width: 290px;
  padding: 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  color: #fff;
}

#widget-header {
  text-align: center;
  margin-bottom: 16px;
}
#widget-header h2 {
  font-size: 16px;
  letter-spacing: 1px;
  color: #a8b2c8;
  text-transform: uppercase;
}
#status-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #3a3a5c;
  color: #a8b2c8;
}
#status-badge.available { background: #1a5c3a; color: #4cde8c; }
#status-badge.busy      { background: #5c1a1a; color: #de4c4c; }
#status-badge.paused    { background: #5c4a1a; color: #deb84c; }

#log-area {
  background: #0f1e35;
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  color: #5a8fd0;
  min-height: 52px;
  max-height: 52px;
  overflow-y: auto;
  margin-bottom: 14px;
  font-family: monospace;
  line-height: 1.4;
}

/* ── Login Screen ───────────────────────────────────────────────────────────── */
#login-screen { text-align: center; }
#btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #0f3460, #533483);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity 0.2s;
}
#btn-login:hover    { opacity: 0.85; }
#btn-login:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Auth Callback Screen ───────────────────────────────────────────────────── */
#auth-screen {
  display: none;
  text-align: center;
  padding: 16px 0;
}
.auth-message {
  font-size: 15px;
  font-weight: 600;
  color: #a8d0e6;
  margin-bottom: 8px;
}
.auth-sub {
  font-size: 12px;
  color: #5a8fd0;
}

/* ── Softphone Screen ───────────────────────────────────────────────────────── */
#softphone-screen { display: none; }

#dial-input-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
#dial-input {
  flex: 1;
  background: #0f1e35;
  border: 1px solid #2a3f6a;
  border-radius: 8px;
  color: #e0e8ff;
  font-size: 18px;
  padding: 8px 12px;
  letter-spacing: 2px;
  outline: none;
  font-family: monospace;
}
#dial-input::placeholder { color: #3a4f7a; font-size: 12px; letter-spacing: 0; }
#dial-input:focus { border-color: #4a7fd0; }

#btn-clear-input {
  background: #2a2a4a;
  border: none;
  border-radius: 8px;
  color: #a8b2c8;
  font-size: 16px;
  padding: 8px 12px;
  cursor: pointer;
}
#btn-clear-input:hover { background: #3a3a5c; }

#keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}
.key-btn {
  background: #1e2f50;
  border: none;
  border-radius: 8px;
  color: #fff;
  padding: 11px 0;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.key-btn:hover  { background: #2a3f6a; }
.key-btn:active { background: #0f3460; }

#btn-call {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #1a5c3a, #0f7a3a);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  margin-bottom: 10px;
  transition: opacity 0.2s;
}
#btn-call:hover    { opacity: 0.88; }
#btn-call:disabled { opacity: 0.4; cursor: not-allowed; }
#btn-call.end-call { background: linear-gradient(135deg, #5c1a1a, #7a0f0f); }
#btn-call.calling  { background: linear-gradient(135deg, #3a3a5c, #2a2a4a); }

#action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.action-btn {
  padding: 10px 6px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  letter-spacing: 0.5px;
}
.action-btn:hover    { opacity: 0.85; }
.action-btn:disabled { opacity: 0.35; cursor: not-allowed; }

#btn-mute              { background: #533483; color: #fff; }
#btn-mute.active       { background: #de4c4c; color: #fff; }
#btn-transfer          { background: #0f3460; color: #fff; }
#btn-pause             { background: #5c4a1a; color: #deb84c; }
#btn-pause.ready       { background: #1a5c3a; color: #4cde8c; }
#btn-logout            { background: #3a1a1a; color: #de4c4c; }

/* ── Inbound Call Panel ─────────────────────────────────────────────────────── */
#inbound-panel {
  display: none;
  background: linear-gradient(135deg, #0f2a1a, #0a3a1a);
  border: 1px solid #1a6a3a;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  text-align: center;
}
#inbound-label {
  font-size: 13px;
  font-weight: 700;
  color: #4cde8c;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
#inbound-caller {
  font-size: 15px;
  font-weight: 700;
  color: #e0e8ff;
  margin-bottom: 4px;
}
#inbound-number {
  font-size: 13px;
  color: #a8b2c8;
  font-family: monospace;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
#inbound-timer {
  font-size: 28px;
  font-weight: 700;
  font-family: monospace;
  color: #4cde8c;
  margin-bottom: 14px;
  letter-spacing: 3px;
}
#btn-end-inbound {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #5c1a1a, #7a0f0f);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity 0.2s;
}
#btn-end-inbound:hover { opacity: 0.85; }
