/* Stay Collective Phone app — SC design language (greens/gold/cream),
   responsive desktop + mobile. */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Nunito Sans', system-ui, sans-serif;
  background: linear-gradient(135deg, #f6f2e8 0%, #edf5ef 100%);
  color: #173c2c;
}

.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1b4332;
  color: #d4a853;
  display: grid;
  place-items: center;
  font-family: 'Public Sans', sans-serif;
  font-weight: 800;
}

.brand-name { font-family: 'Public Sans', sans-serif; font-weight: 800; }
.brand-sub { color: #66766d; font-size: 0.85rem; }

.user { display: flex; align-items: center; gap: 8px; color: #66766d; font-size: 0.95rem; flex-wrap: wrap; }

.logout, .install {
  border: 0;
  background: #1b4332;
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}
.install { display: none; background: #d4a853; color: #173c2c; }
.install.visible { display: inline-flex; }

.phone-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 67, 50, 0.14);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(21, 55, 40, 0.09);
  padding: 22px 22px 18px;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.phone-card h1 {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.5rem;
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  font-weight: 700;
  font-size: 0.85rem;
  color: #4b5563;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
}

.status-pill[data-state="ready"] { background: #e8f3ec; color: #1b4332; }
.status-pill[data-state="ready"] .status-dot { background: #1b4332; }
.status-pill[data-state="connected"],
.status-pill[data-state="muted"] { background: #e8f3ec; color: #1b4332; }
.status-pill[data-state="connected"] .status-dot,
.status-pill[data-state="muted"] .status-dot { background: #1b4332; }
.status-pill[data-state="connecting"],
.status-pill[data-state="ringing"] { background: #fdf3e0; color: #b8842f; }
.status-pill[data-state="connecting"] .status-dot,
.status-pill[data-state="ringing"] .status-dot { background: #d4a853; }
.status-pill[data-state="error"],
.status-pill[data-state="permission-denied"] { background: #fef2f2; color: #b91c1c; }
.status-pill[data-state="error"] .status-dot,
.status-pill[data-state="permission-denied"] .status-dot { background: #b91c1c; }

.phone-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
}

.phone-diag {
  color: #66766d;
  font-size: 12px;
  margin: 6px 0 0;
}

.phone-incoming {
  border: 1px solid rgba(27, 67, 50, 0.25);
  border-radius: 10px;
  padding: 12px;
  margin: 14px 0;
  background: #f0fdf4;
}
.phone-incoming-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #374151;
  margin: 0;
}
.phone-incoming-from { font-size: 18px; font-weight: 700; margin: 4px 0 10px; }

.phone-incoming-actions, .phone-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.btn-primary, .btn-secondary {
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: #1b4332; color: #fff; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-secondary { background: #fff; border-color: rgba(27, 67, 50, 0.25); color: #173c2c; }
.btn-secondary:disabled { color: #9ca3af; border-color: #e5e7eb; cursor: not-allowed; }
.phone-hangup { color: #b91c1c; border-color: #fecaca; }
.phone-hangup:disabled { color: #9ca3af; border-color: #e5e7eb; }

.phone-label { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 4px; }
.phone-dest {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 17px;
  padding: 12px;
  font-family: inherit;
}
.phone-dest:focus-visible { outline: 2px solid #1b4332; outline-offset: 1px; }
.phone-hint { color: #66766d; font-size: 12px; margin: 6px 0 12px; }

.phone-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0 8px;
}
.phone-key {
  border: 1px solid rgba(27, 67, 50, 0.14);
  border-radius: 10px;
  background: #fafaf8;
  font-size: 19px;
  font-weight: 700;
  font-family: inherit;
  color: #173c2c;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.phone-key:hover { background: #edf5ef; }
.phone-key:focus-visible { outline: 2px solid #1b4332; outline-offset: 2px; }
.phone-key-sub { font-size: 10px; color: #9ca3af; letter-spacing: 0.08em; }

.phone-footnote { color: #66766d; font-size: 12px; margin-top: 14px; }

/* ===== Login ===== */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.login-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(27, 67, 50, 0.14);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(21, 55, 40, 0.09);
  padding: 32px 28px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.login-brand { margin-bottom: 12px; }
.login-logo { width: 72px; height: 72px; border-radius: 16px; }
.login-heading { font-family: 'Public Sans', sans-serif; margin: 0 0 6px; }
.login-subtitle { color: #66766d; margin: 0 0 20px; }
.google-login-section { display: grid; justify-items: center; gap: 12px; }
.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  padding: 8px 12px;
  font-size: 13px;
}
.domain-note { color: #66766d; font-size: 12px; margin: 4px 0 0; }
.login-help { color: #66766d; font-size: 13px; margin: 14px 0 0; }
.login-help a { color: #1b4332; font-weight: 700; }

/* ===== Responsive ===== */
@media (max-width: 620px) {
  .shell { padding: 16px 12px 32px; }
  .top { align-items: flex-start; }
  .phone-card { padding: 18px 14px 14px; max-width: none; }
  .status-row { flex-direction: column; align-items: flex-start; }
  .phone-actions .btn-primary,
  .phone-actions .btn-secondary { flex: 1 1 46%; }
  .phone-key { padding: 14px 0; }
}
