/* Marcador VoIP.ms — estilos */
:root {
  --primary: #2a5298;
  --primary-dark: #1e3c72;
  --call: #28a745;
  --call-dark: #1e7e34;
  --hangup: #dc3545;
  --hangup-dark: #b02a37;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-alt: #f5f7fb;
  --text: #1a1f36;
  --text-muted: #5a6478;
  --border: #d9dde6;
  --shadow: 0 10px 30px rgba(20, 30, 60, 0.12);
  --radius: 18px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.phone {
  width: 100%;
  max-width: 400px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header */
.phone__header {
  text-align: center;
}

.phone__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.flag {
  font-size: 1.2em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--surface);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.status__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #aab1c0;
  display: inline-block;
  transition: background 0.2s;
}

.status__dot--idle { background: #aab1c0; }
.status__dot--connecting {
  background: #f5b400;
  animation: pulse 1s infinite;
}
.status__dot--ok { background: var(--call); }
.status__dot--error { background: var(--hangup); }

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

/* Selector país */
.country {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.country__option input {
  display: none;
}

.country__pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.country__pill small {
  color: var(--text-muted);
  font-weight: 400;
}

.country__option input:checked + .country__pill {
  border-color: var(--primary);
  background: #e8efff;
  color: var(--primary-dark);
}

/* Display */
.display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 12px;
  border: 1px solid var(--border);
}

.display__prefix {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-right: 4px;
}

.display__input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text);
  font-family: inherit;
  min-width: 0;
}

.display__input::placeholder {
  color: #b2bbcb;
  font-weight: 400;
}

.display__back {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}

.display__back:hover { background: var(--surface-alt); }
.display__back:active { background: #e6e9f0; }

/* Timer */
.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: #fff5f5;
  border: 1px solid #ffd9d9;
  border-radius: 12px;
  color: var(--hangup);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timer__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hangup);
  animation: pulse 1.2s infinite;
}

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.05s, background 0.15s, box-shadow 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.key:hover {
  background: var(--surface-alt);
}

.key:active,
.key.is-pressed {
  background: #dde3f0;
  transform: scale(0.95);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
}

.key__num {
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
}

.key__letters {
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 2px;
  min-height: 0.7em;
}

/* Actions */
.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 6px 0 2px;
}

.action {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  font-size: 1.9rem;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 6px 14px rgba(0,0,0,0.18);
}

.action--call {
  background: var(--call);
}
.action--call:hover { background: var(--call-dark); }
.action--call:active { transform: scale(0.94); }
.action--call:disabled {
  background: #9bcfac;
  cursor: not-allowed;
  box-shadow: none;
}

.action--hangup {
  background: var(--hangup);
  animation: hangup-shake 0.4s;
}
.action--hangup:hover { background: var(--hangup-dark); }
.action--hangup:active { transform: scale(0.94); }

@keyframes hangup-shake {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Error */
.error {
  background: #fff0f0;
  border: 1px solid #ffc9c9;
  color: #a02020;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  text-align: center;
}

/* Recents */
.recents {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.recents__title {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.recents__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recents__empty {
  color: #a0a8b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 10px;
}

.recent {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid var(--border);
}

.recent:hover { background: var(--surface-alt); }

.recent__number {
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.recent__time {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: right;
}

.recent__status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.recent__status--ok { color: var(--call); }
.recent__status--missed { color: var(--hangup); }

.recent__duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* User bar */
.phone__userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.8rem;
}

.phone__user {
  color: var(--text-muted);
  font-weight: 500;
}

.phone__logout {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.phone__logout:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-muted);
}

/* ============ LOGIN ============ */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 28px 30px;
  text-align: center;
}

.login-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.login-sub {
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.login-field input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.15);
}

.login-submit {
  margin-top: 6px;
  padding: 13px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.05s;
}

.login-submit:hover { background: var(--primary-dark); }
.login-submit:active { transform: scale(0.98); }
.login-submit:disabled {
  background: #99a8c5;
  cursor: not-allowed;
}

.login-error {
  margin-top: 16px;
  background: #fff0f0;
  border: 1px solid #ffc9c9;
  color: #a02020;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.85rem;
  text-align: center;
}

/* Responsive */
@media (max-width: 360px) {
  .phone { padding: 16px 14px 18px; }
  .key__num { font-size: 1.5rem; }
  .display__input { font-size: 1.4rem; }
  .action { width: 60px; height: 60px; font-size: 1.6rem; }
}
