/*
 * Next Self-Catering demo site: banner + "Try the demo as..." switcher (switcher.js).
 * Every class starts with nscd-; nothing styles the template.
 *
 * (C) 2026 NextSoftware Team. GNU General Public License version 2 or later.
 */

.nscd-banner,
.nscd-pill,
.nscd-dialog {
  --nscd-accent: #0f766e;
  --nscd-accent-text: #fff;
  --nscd-surface: #fff;
  --nscd-text: #1f2937;
  --nscd-muted: #6b7280;
  --nscd-border: #e5e7eb;
  --nscd-hover: #f3f4f6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
  .nscd-banner,
  .nscd-pill,
  .nscd-dialog {
    --nscd-accent: #2dd4bf;
    --nscd-accent-text: #042f2e;
    --nscd-surface: #1f2937;
    --nscd-text: #f3f4f6;
    --nscd-muted: #9ca3af;
    --nscd-border: #374151;
    --nscd-hover: #273244;
  }
}

.nscd-dialog *,
.nscd-pill * {
  box-sizing: border-box;
}

.nscd-banner {
  padding: 6px 16px;
  background: var(--nscd-accent);
  color: var(--nscd-accent-text);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.nscd-pill {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--nscd-accent);
  color: var(--nscd-accent-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 20px rgb(0 0 0 / 25%);
  cursor: pointer;
}

.nscd-pill:focus-visible,
.nscd-dialog button:focus-visible,
.nscd-dialog a:focus-visible {
  outline: 3px solid var(--nscd-accent);
  outline-offset: 2px;
}

.nscd-pill:focus-visible {
  outline-color: var(--nscd-text);
}

.nscd-pill-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .8;
}

.nscd-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 20px;
  border: 1px solid var(--nscd-border);
  border-radius: 14px;
  background: var(--nscd-surface);
  color: var(--nscd-text);
  box-shadow: 0 20px 50px rgb(0 0 0 / 30%);
  overflow-y: auto;
}

.nscd-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.nscd-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nscd-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: inherit;
}

.nscd-close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--nscd-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.nscd-close:hover {
  background: var(--nscd-hover);
}

.nscd-intro {
  margin: 8px 0 16px;
  color: var(--nscd-muted);
  font-size: 14px;
  line-height: 1.5;
}

.nscd-cards {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nscd-cards li {
  margin: 0;
}

.nscd-card,
.nscd-signout {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--nscd-border);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}

.nscd-card:hover,
.nscd-signout:hover {
  background: var(--nscd-hover);
  color: inherit;
  text-decoration: none;
}

.nscd-card[aria-current="true"] {
  border-color: var(--nscd-accent);
}

.nscd-card:disabled,
.nscd-signout:disabled {
  cursor: progress;
  opacity: .6;
}

.nscd-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nscd-avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--nscd-accent);
  color: var(--nscd-accent-text);
  font-size: 14px;
  font-weight: 700;
}

.nscd-card-head {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.nscd-card-name {
  font-size: 15px;
  font-weight: 600;
}

.nscd-card-role,
.nscd-card-blurb {
  color: var(--nscd-muted);
  font-size: 13px;
  line-height: 1.45;
}

.nscd-card-state {
  color: var(--nscd-accent);
  font-size: 12px;
  font-weight: 600;
}

.nscd-signout {
  margin-top: 10px;
}

.nscd-error {
  margin: 12px 0 0;
  color: #b91c1c;
  font-size: 14px;
}

@media (prefers-color-scheme: dark) {
  .nscd-error {
    color: #fca5a5;
  }
}

@media print {
  .nscd-banner,
  .nscd-pill,
  .nscd-dialog {
    display: none !important;
  }
}

/* Above the property page's fixed mobile bar (Next Self-Catering's part/bar.php), never over its
 * Book button. */
@media (max-width: 63.999rem) {
  body:has([data-nsc-property-bar]) .nscd-pill {
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }
}
