/* Cocktel Hub: one stylesheet, no framework. WCAG 2.2 AA: contrast of at
   least 4.5 to 1 in both color schemes, visible focus, 44 by 44 pixel
   targets, reflow at 320 pixels, reduced motion respected. */

:root {
  color-scheme: light dark;
  --background: #ffffff;
  --text: #1a1a1a;
  --muted: #4a4a4a;
  --accent: #0b5cad;
  --accent-text: #ffffff;
  --error: #b00020;
  --border: #6b6b6b;
  --surface: #f2f4f7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #121212;
    --text: #f0f0f0;
    --muted: #c8c8c8;
    --accent: #7ab8ff;
    --accent-text: #0d1b2a;
    --error: #ff8a80;
    --border: #9a9a9a;
    --surface: #1e2329;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -10rem;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-text);
  z-index: 10;
}

.skip:focus {
  top: 1rem;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

.brand {
  margin: 0;
  font-weight: 700;
  font-size: 1.125rem;
}

.brand .host {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a,
nav button.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
}

nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
}

nav form {
  margin: 0;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

main:focus {
  outline: none;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 1rem 0 1.25rem;
}

h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: 0.5rem;
  background: var(--background);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button.primary,
.button.primary {
  background: var(--accent);
  color: var(--accent-text);
}

button.link {
  border: none;
  padding: 0;
  background: none;
  color: var(--accent);
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

button[aria-disabled="true"] {
  cursor: progress;
  opacity: 0.85;
}

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

.field {
  margin: 0 0 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

input[type="text"],
input[type="password"] {
  display: block;
  width: 100%;
  max-width: 28rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0.375rem;
  background: var(--background);
  color: var(--text);
  font: inherit;
}

input[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error,
.message.error {
  color: var(--error);
  font-weight: 600;
}

.field-error {
  margin: 0 0 0.375rem;
}

input + .field-error {
  margin: 0.375rem 0 0;
}

.message {
  min-height: 1.5em;
  margin: 0.75rem 0 1rem;
}

.status {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

.lab {
  margin-top: 2.5rem;
  padding: 1rem;
  border: 2px dashed var(--border);
  border-radius: 0.5rem;
}

.lab h2 {
  margin-top: 0;
}

/* Slice 2: the signed-in pages. */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button.danger,
.button.danger {
  border-color: var(--error);
  background: var(--error);
  color: var(--background);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

.more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.items {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.items > li {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.items > li:last-child {
  border-bottom: 1px solid var(--border);
}

.items h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1875rem;
  overflow-wrap: anywhere;
}

.items h2 a {
  display: inline-block;
  min-height: 44px;
  padding: 0.375rem 0;
}

.items p {
  margin: 0.25rem 0;
}

.items .button {
  margin-top: 0.5rem;
}

.detail,
.hint {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hint {
  margin: 0.375rem 0 0;
}

.problem {
  color: var(--error);
  font-weight: 600;
}

.error-summary {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 4px solid var(--error);
  border-radius: 0.375rem;
}

.error-summary:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.error-summary h2 {
  margin: 0 0 0.5rem;
}

.error-summary ul {
  margin: 0 0 0.5rem;
  padding-left: 1.25rem;
}

.error-summary a {
  color: var(--error);
  font-weight: 600;
}

.error-summary form {
  margin-top: 1rem;
}

.status p {
  margin: 0.25rem 0;
}

fieldset {
  margin: 0 0 1.25rem;
  padding: 0;
  border: none;
  min-width: 0;
}

legend {
  padding: 0;
  margin-bottom: 0.375rem;
  font-weight: 600;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.choice input {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin: 0;
  accent-color: var(--accent);
}

.choice label {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  font-weight: 400;
}

.show-password {
  margin-top: 0.25rem;
}

details.advanced {
  margin: 0 0 1.25rem;
  padding: 0 1rem;
  border: 2px solid var(--border);
  border-radius: 0.5rem;
}

details.advanced > summary {
  display: list-item;
  min-height: 44px;
  padding: 0.625rem 0;
  font-weight: 600;
  cursor: pointer;
}

details.advanced[open] > summary {
  margin-bottom: 0.75rem;
}

.form-message {
  min-height: 1.5em;
  margin: 0.75rem 0 1rem;
}

.form-message:empty {
  min-height: 0;
  margin: 0;
}

.form-message.error {
  color: var(--error);
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
