:root { color-scheme: light dark; }
* { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 2rem;
  max-width: 64rem;
  margin-inline: auto;
  line-height: 1.5;
}

header h1 { margin: 0 0 0.25rem; font-size: 1.5rem; }
header p   { margin: 0 0 1.5rem; }

.muted { color: #888; font-size: 0.875rem; }
.error { color: #c33; min-height: 1.2em; }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1rem;
}
th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}
th { font-weight: 600; }
td:last-child { text-align: right; white-space: nowrap; }

button {
  font: inherit;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: color-mix(in srgb, currentColor 5%, transparent);
}
button:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
button.danger { color: #c33; }
button.link {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

input {
  font: inherit;
  padding: 0.4rem 0.5rem;
  width: 100%;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  background: transparent;
  color: inherit;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 1.5rem;
  min-width: 24rem;
  background: Canvas;
  color: CanvasText;
}
dialog::backdrop { background: rgb(0 0 0 / 0.4); }
dialog form > label {
  display: block;
  margin-bottom: 1rem;
}
dialog form > label small { color: #888; font-weight: normal; }
dialog .actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

body.centered {
  display: grid;
  place-items: center;
  min-height: 80vh;
}
.login { max-width: 22rem; width: 100%; }
.login form { display: grid; gap: 1rem; }
.login label { display: grid; gap: 0.25rem; }
.login button { padding: 0.6rem; }

#history-dialog { min-width: 46rem; max-width: 90vw; }
.history-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.history-header h3 { margin: 0; }
.history-pager {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 1rem; gap: 1rem;
}
.history-pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.disposition-answered  { color: #2a7; }
.disposition-no-answer { color: #c80; }
.disposition-busy      { color: #c80; }
.disposition-failed    { color: #c33; }

/* ---- Portal ---- */

.portal-login { text-align: center; }
.admin-link { margin-top: 1.5rem; }
.provider-buttons { display: grid; gap: 0.6rem; margin-top: 1.5rem; }
.provider-btn {
  display: block;
  padding: 0.7rem 1rem;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  color: inherit;
  font-weight: 500;
  transition: background 0.1s;
}
.provider-btn:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.provider-google    { border-color: #4285F4; }
.provider-microsoft { border-color: #0078D4; }
.provider-apple     { border-color: currentColor; }
.provider-yahoo     { border-color: #6001D2; }
.provider-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.card {
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card h2 { margin-top: 0; font-size: 1.1rem; }

.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.25rem;
  margin: 1rem 0;
  align-items: baseline;
}
.kv > span:nth-child(odd) { color: #888; font-size: 0.875rem; }
.kv code { font-size: 1rem; }

.danger-zone { border-color: #c33; }
.danger-zone h2 { color: #c33; }

button.danger {
  color: #fff;
  background: #c33;
  border-color: #c33;
}
button.danger:hover { background: #a22; }

button.link.danger { color: #c33; background: transparent; }

.provision-steps {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.6;
}
.provision-steps em { font-style: normal; font-weight: 600; }
