/* ============================================================
   UB SSW Sign-Up — shared styles
   Brand: UB Blue (#005bbb) + Hayes Hall White dominant.
   Secondary palette used sparingly (dynamic color bar, accents).
   Type: Sofia Pro substitute stack per UB guidance (Arial),
   with Sofia Sans webfont as a free approximation; Georgia
   stands in for More Pro in editorial moments.
   ============================================================ */

:root {
  /* Primary palette */
  --ub-blue: #005bbb;          /* AA on white (5.6:1) */
  --white: #ffffff;
  /* Secondary palette (use sparingly) */
  --harriman-blue: #002f56;    /* AA on white */
  --capen-brick: #990000;      /* AA on white — errors */
  --niagara: #006570;          /* AA on white — success */
  --townsend-gray: #666666;    /* AA on white — secondary text */
  --baird-point: #e4e4e4;      /* borders, quiet backgrounds */
  --victor-blue: #2f9fd0;      /* decorative only */
  --letchworth: #e56a54;       /* decorative only */
  --solar-strand: #ffc72c;     /* decorative only */
  --lake-lasalle: #00a69c;     /* decorative only */
  --olmsted: #6da04b;          /* decorative only */
  --ink: #1a1a1a;
  --paper-quiet: #f7f8fa;

  --sans: "Sofia Sans", Arial, Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", serif;

  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 47, 86, 0.10), 0 4px 14px rgba(0, 47, 86, 0.06);
  --focus-ring: 3px solid #002f56;
  --maxw: 920px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--white);
}

/* ---------- Accessibility primitives ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--harriman-blue);
  color: var(--white);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

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

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Dynamic color bar (UB graphic element) ---------- */

.color-bar {
  display: flex;
  height: 6px;
}
.color-bar span { display: block; height: 100%; }
.color-bar .c1 { flex: 14; background: var(--ub-blue); }
.color-bar .c2 { flex: 2;  background: var(--victor-blue); }
.color-bar .c3 { flex: 1;  background: var(--solar-strand); }
.color-bar .c4 { flex: 2;  background: var(--lake-lasalle); }
.color-bar .c5 { flex: 1;  background: var(--letchworth); }
.color-bar .c6 { flex: 3;  background: var(--harriman-blue); }

/* ---------- Header / footer ---------- */

.site-header {
  background: var(--ub-blue);
  color: var(--white);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.wordmark {
  color: var(--white);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.wordmark:hover, .wordmark:focus-visible { text-decoration: underline; }
.wordmark .ub { 
  border: 2px solid var(--white);
  padding: 0.05rem 0.4rem;
  margin-right: 0.55rem;
  display: inline-block;
  font-weight: 800;
}
.site-tag {
  color: var(--white);
  font-size: 0.95rem;
  opacity: 0.95;
}

.site-footer {
  margin-top: 4rem;
  background: var(--harriman-blue);
  color: var(--white);
}
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
  font-size: 0.95rem;
  line-height: 1.7;
}
.site-footer a { color: var(--white); }

/* ---------- Layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3rem;
}

h1, h2, h3 {
  font-family: var(--sans);
  line-height: 1.15;
  color: var(--harriman-blue);
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(1.85rem, 4.5vw, 2.6rem); font-weight: 800; letter-spacing: -0.015em; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }

p { margin: 0 0 1rem; }
.lede {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--ink);
  max-width: 42rem;
}
.muted { color: var(--townsend-gray); }
.small { font-size: 0.92rem; }

a { color: var(--ub-blue); text-underline-offset: 2px; }
a:hover { color: var(--harriman-blue); }

/* Dashed rule — UB lines-and-bullets vocabulary */
.dash-rule {
  border: 0;
  border-top: 2px dashed var(--ub-blue);
  margin: 2rem 0;
}

.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ub-blue);
  margin-bottom: 0.5rem;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.85rem 1.4rem;
  min-height: 44px;
  border-radius: var(--radius);
  border: 2px solid var(--ub-blue);
  background: var(--ub-blue);
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover { background: var(--harriman-blue); border-color: var(--harriman-blue); color: var(--white); }
.btn .arrow { font-weight: 800; }

.btn-secondary {
  background: var(--white);
  color: var(--ub-blue);
}
.btn-secondary:hover { background: var(--paper-quiet); color: var(--harriman-blue); }

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ub-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0.6rem 0.8rem;
}
.btn-quiet:hover { background: var(--paper-quiet); color: var(--harriman-blue); }

.btn-danger {
  background: var(--white);
  border-color: var(--capen-brick);
  color: var(--capen-brick);
}
.btn-danger:hover { background: var(--capen-brick); border-color: var(--capen-brick); color: var(--white); }

.btn[disabled], .btn[aria-disabled="true"] {
  background: var(--baird-point);
  border-color: var(--baird-point);
  color: var(--townsend-gray);
  cursor: not-allowed;
}

/* ---------- Forms ---------- */

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--harriman-blue);
}
.field .hint {
  display: block;
  font-size: 0.9rem;
  color: var(--townsend-gray);
  margin-bottom: 0.35rem;
}
input[type="text"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  border: 2px solid var(--townsend-gray);
  border-radius: var(--radius);
  background: var(--white);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 1px;
  border-color: var(--harriman-blue);
}
textarea { min-height: 7rem; resize: vertical; }

.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: var(--capen-brick);
}
.error-text {
  color: var(--capen-brick);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 0.35rem;
}
.error-text::before { content: "\26A0  "; } /* warning sign + text, not color alone */

.form-banner {
  border: 2px solid var(--capen-brick);
  border-left-width: 8px;
  background: #fdf3f3;
  color: var(--ink);
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.form-banner strong { color: var(--capen-brick); }

.success-banner {
  border: 2px solid var(--niagara);
  border-left-width: 8px;
  background: #f0f7f7;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.success-banner strong { color: var(--niagara); }

/* ---------- Cards ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--baird-point);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ---------- Session list (public page) ---------- */

.day-group { margin: 0 0 2.25rem; }
.day-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.day-heading h2 { margin: 0; font-size: 1.25rem; }
.day-heading::after {
  content: "";
  flex: 1;
  border-top: 2px dashed var(--ub-blue);
}

.session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; }

.session {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  border: 1px solid var(--baird-point);
  border-left: 6px solid var(--ub-blue);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
}
.session.full {
  border-left-color: var(--townsend-gray);
  background: var(--paper-quiet);
  box-shadow: none;
}
.session.past { border-left-color: var(--townsend-gray); background: var(--paper-quiet); box-shadow: none; }

.session .time {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--harriman-blue);
  min-width: 11rem;
}
.session .avail { flex: 1; min-width: 12rem; }

.spots-text { font-weight: 700; }
.spots-text.open { color: var(--niagara); }
.spots-text.low { color: var(--capen-brick); }
.spots-text.none { color: var(--townsend-gray); }

.meter {
  margin-top: 0.4rem;
  height: 8px;
  border-radius: 4px;
  background: var(--baird-point);
  overflow: hidden;
  max-width: 16rem;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--ub-blue);
  transition: width 0.3s ease;
}
.session.full .meter > span { background: var(--townsend-gray); }

.full-label {
  display: inline-block;
  font-weight: 800;
  color: var(--townsend-gray);
  border: 2px solid var(--townsend-gray);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
}

/* ---------- Dialog ---------- */

dialog {
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 47, 86, 0.35);
  padding: 0;
  width: min(33rem, calc(100vw - 2rem));
}
dialog::backdrop { background: rgba(0, 47, 86, 0.55); }
.dialog-inner { padding: 1.75rem; }
.dialog-inner .color-bar { border-radius: var(--radius) var(--radius) 0 0; }

/* ---------- Create form: session builder ---------- */

.session-builder { display: grid; gap: 1rem; }
.session-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 0.8fr auto;
  gap: 0.75rem;
  align-items: end;
  border: 1px solid var(--baird-point);
  border-left: 6px solid var(--ub-blue);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--white);
}
.session-row .field { margin-bottom: 0; }
.session-row .row-actions { display: flex; gap: 0.25rem; padding-bottom: 0.15rem; }
.icon-btn {
  border: 2px solid transparent;
  background: transparent;
  color: var(--ub-blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--radius);
}
.icon-btn:hover { background: var(--paper-quiet); }
.icon-btn.remove { color: var(--capen-brick); }

@media (max-width: 760px) {
  .session-row { grid-template-columns: 1fr 1fr; }
  .session-row .row-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- Share / link boxes ---------- */

.link-box {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  border: 2px dashed var(--ub-blue);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  background: var(--paper-quiet);
  margin: 0.5rem 0 1.25rem;
}
.link-box code {
  flex: 1;
  min-width: 14rem;
  font-size: 0.95rem;
  word-break: break-all;
  color: var(--harriman-blue);
}

/* ---------- Roster tables (manage) ---------- */

.roster { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.roster caption { text-align: left; font-weight: 800; color: var(--harriman-blue); padding-bottom: 0.4rem; }
.roster th, .roster td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--baird-point);
  vertical-align: middle;
}
.roster th {
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--townsend-gray);
}
.roster .empty td { color: var(--townsend-gray); font-style: italic; }

.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.25rem 0 1.75rem; }
.stat {
  flex: 1;
  min-width: 10rem;
  border: 1px solid var(--baird-point);
  border-top: 6px solid var(--ub-blue);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  background: var(--white);
  box-shadow: var(--shadow);
}
.stat .num { font-size: 1.7rem; font-weight: 800; color: var(--harriman-blue); display: block; }
.stat .lbl { color: var(--townsend-gray); font-size: 0.92rem; }

/* ---------- Landing: how it works ---------- */

.hero {
  padding: 3.25rem 0 2.5rem;
}
.steps {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.steps li {
  border: 1px solid var(--baird-point);
  border-top: 6px solid var(--ub-blue);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.steps .step-arrow {
  font-weight: 800;
  color: var(--ub-blue);
  font-size: 1.4rem;
  display: block;
  margin-bottom: 0.4rem;
}
.steps h3 { margin-bottom: 0.35rem; }
.steps p { margin: 0; color: var(--townsend-gray); font-size: 0.97rem; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--harriman-blue);
  color: var(--white);
  font-weight: 700;
  padding: 0.8rem 1.3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
}

/* ---------- Print (rosters) ---------- */

@media print {
  .site-header, .site-footer, .color-bar, .no-print, .btn, .icon-btn { display: none !important; }
  body { font-size: 11pt; }
  .card, .stat, .session { box-shadow: none; }
}
