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

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

/* ── Phone shell ── */
.phone {
  background: #1f2937;
  border-radius: 40px;
  padding: 32px 24px 28px;
  width: 320px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Status indicator ── */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6b7280;
  flex-shrink: 0;
  transition: background 0.3s;
}

.status-dot.connecting { background: #f59e0b; animation: pulse 1.4s infinite; }
.status-dot.ready      { background: #10b981; }
.status-dot.calling    { background: #f59e0b; animation: pulse 0.9s infinite; }
.status-dot.active     { background: #10b981; animation: pulse 1.2s infinite; }
.status-dot.error      { background: #ef4444; }

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

.status-text {
  color: #9ca3af;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Number display ── */
.display {
  display: flex;
  align-items: center;
  background: #111827;
  border-radius: 16px;
  padding: 12px 14px;
  gap: 8px;
}

#numberInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f9fafb;
  font-size: 22px;
  letter-spacing: 2px;
  text-align: center;
  font-family: inherit;
  min-width: 0;
}

#numberInput::placeholder {
  color: #374151;
  font-size: 14px;
  letter-spacing: 1px;
}

.backspace {
  background: transparent;
  border: none;
  color: #4b5563;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 2px;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.backspace:hover { color: #f9fafb; }

/* ── Timer ── */
.timer {
  text-align: center;
  color: #10b981;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
  margin-top: -8px;
}

/* ── Dialpad ── */
.dialpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.dial-key {
  background: #374151;
  border: none;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  color: #f9fafb;
  font-size: 22px;
  font-weight: 500;
  cursor: pointer;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  transition: background 0.12s, transform 0.08s;
  user-select: none;
}

.dial-key .sub {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #9ca3af;
  margin-top: 2px;
  font-weight: 400;
}

.dial-key:hover  { background: #4b5563; }
.dial-key:active { background: #6b7280; transform: scale(0.93); }

/* ── Controls ── */
.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 4px;
}

.btn-call,
.btn-hangup,
.btn-mute {
  border: none;
  border-radius: 50%;
  width: 68px;
  height: 68px;
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s, transform 0.08s;
}

.btn-call    { background: #10b981; }
.btn-hangup  { background: #ef4444; }
.btn-mute    { background: #374151; font-size: 22px; width: 52px; height: 52px; }

.btn-call:hover,
.btn-hangup:hover,
.btn-mute:hover  { filter: brightness(1.15); }

.btn-call:active,
.btn-hangup:active,
.btn-mute:active { transform: scale(0.93); }

.btn-mute.muted { background: #6b7280; }

/* ── Top bar (status + balance) ── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-bar .status { justify-content: flex-start; }

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-link {
  font-size: 18px;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.settings-link:hover { opacity: 1; }

.balance-chip {
  background: #374151;
  color: #10b981;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
}
.balance-chip:hover { background: #4b5563; }

/* ── Rate label ── */
.rate-label {
  text-align: center;
  color: #6b7280;
  font-size: 12px;
  letter-spacing: 0.5px;
  min-height: 16px;
  margin-top: -12px;
}

/* ── Auth pages ── */
.auth-card {
  background: #1f2937;
  border-radius: 24px;
  padding: 40px 32px;
  width: 360px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-logo { font-size: 40px; text-align: center; }

.auth-title {
  color: #f9fafb;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.auth-subtitle {
  color: #6b7280;
  font-size: 14px;
  text-align: center;
  margin-top: -12px;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
}

.field input {
  background: #111827;
  border: 1px solid #374151;
  border-radius: 10px;
  padding: 11px 14px;
  color: #f9fafb;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: #10b981; }

.btn-primary {
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s;
  margin-top: 4px;
}
.btn-primary:hover    { filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-error {
  background: #450a0a;
  border: 1px solid #ef4444;
  color: #fca5a5;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.auth-success {
  background: #052e16;
  border: 1px solid #10b981;
  color: #6ee7b7;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.auth-switch {
  color: #6b7280;
  font-size: 13px;
  text-align: center;
}
.auth-switch a { color: #10b981; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ── Top-up page ── */
.topup-card {
  background: #1f2937;
  border-radius: 24px;
  padding: 32px 28px;
  width: 380px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.back-link {
  color: #6b7280;
  font-size: 13px;
  text-decoration: none;
}
.back-link:hover { color: #f9fafb; }

.balance-info {
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
}
.balance-info strong { color: #10b981; }

.packs { display: flex; gap: 12px; }

.pack-btn {
  flex: 1;
  background: #374151;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 18px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.pack-btn:hover { border-color: #10b981; background: #3f4f62; }
.pack-btn.featured { border-color: #10b981; }
.pack-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.pack-badge {
  position: absolute;
  top: -10px;
  background: #10b981;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pack-amount { color: #f9fafb; font-size: 24px; font-weight: 700; }
.pack-label  { color: #9ca3af; font-size: 12px; }
.pack-time   { color: #6b7280; font-size: 11px; }

.topup-note {
  color: #4b5563;
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

.btn-logout {
  background: transparent;
  border: 1px solid #374151;
  color: #6b7280;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-logout:hover { border-color: #ef4444; color: #ef4444; }

/* ── Settings page ── */
.settings-card {
  background: #1f2937;
  border-radius: 24px;
  padding: 32px 28px;
  width: 400px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid #374151;
}
.settings-section:first-of-type { border-top: none; padding-top: 0; }

.settings-heading {
  color: #f9fafb;
  font-size: 15px;
  font-weight: 600;
}

.settings-desc {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.btn-secondary {
  background: transparent;
  border: 1px solid #374151;
  color: #9ca3af;
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: #6b7280; color: #f9fafb; }

/* Caller ID status row */
.caller-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111827;
  border-radius: 10px;
  padding: 10px 14px;
}

.caller-number { color: #f9fafb; font-size: 14px; flex: 1; }

.caller-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.caller-badge.verified   { background: #052e16; color: #10b981; }
.caller-badge.unverified { background: #450a0a; color: #ef4444; }

.btn-remove {
  background: transparent;
  border: none;
  color: #4b5563;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}
.btn-remove:hover { color: #ef4444; }

/* ── Utilities ── */
.hidden { display: none !important; }
