/* Global application foundation.
   Page-specific components belong in their own stylesheet. */

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

:root {
  --page-background: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #334155;
  --border: #cbd5e1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --focus-ring: #4da3ff;
  --danger: #b91c1c;
  --warning: #b45309;
  --success: #15803d;
  --info: #1d4ed8;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--page-background);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

h1,
h2,
h3 {
  margin: 0 0 16px;
  color: var(--text);
  line-height: 1.25;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.25rem;
  font-weight: 650;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

p {
  margin: 0 0 16px;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.notices {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

.notice {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
}

.notice + .notice {
  margin-top: 12px;
}

.notice-error {
  border-left-color: var(--danger);
}

.notice-warning {
  border-left-color: var(--warning);
}

.notice-success {
  border-left-color: var(--success);
}

.notice-info {
  border-left-color: var(--info);
}

.test-banner {
  width: 100%;
  padding: 10px 16px;
  background: #7c2d12;
  color: #fff7ed;
  font-size: 14px;
  text-align: center;
}

.test-banner a {
  color: inherit;
  text-decoration: underline;
}

@media (max-width: 560px) {
  main {
    padding: 16px 12px 32px;
  }

  .notices {
    padding: 12px 12px 0;
  }
}

/* Reusable invitation-sharing component. No external widgets or assets. */
.transport-share {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.transport-share [hidden] { display: none !important; }
.transport-share__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.transport-share__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
}
.transport-share__action:hover { color: var(--accent-hover); }
.transport-share__action:disabled { opacity: .65; cursor: wait; }
.transport-share__url { display: block; color: var(--text-muted); }
.transport-share__url input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.transport-share__status { margin-top: 10px; color: var(--text-muted); }

/* Inline questionnaire entity suggestions. */
[data-entity-options][role="listbox"] {
  box-sizing: border-box;
  width: 100%;
  max-height: 16rem;
  margin: 0.25rem 0 0.5rem;
  padding: 0.25rem;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
}

[data-entity-options][hidden] {
  display: none !important;
}

[data-entity-options] [role="option"] {
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  overflow-wrap: anywhere;
  cursor: pointer;
}

[data-entity-options] [role="option"]:hover {
  background: var(--page-background);
}

[data-entity-options] [role="option"][aria-selected="true"] {
  background: var(--accent-hover);
  color: #fff;
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

@media (forced-colors: active) {
  [data-entity-options] [role="option"][aria-selected="true"] {
    background: Highlight;
    color: HighlightText;
    outline-color: HighlightText;
    forced-color-adjust: none;
  }
}
