/* Brand values come from design-system.css; these aliases keep existing
   selectors working while both views share one palette. */
:root {
  --ink: var(--ewu-ink);
  --deep: var(--ewu-blue-dark);
  --muted: var(--ewu-slate);
  --soft: var(--ewu-mist);
  --line: var(--ewu-line);
  --panel: var(--ewu-panel);
  --success: var(--ewu-success);
  --danger: var(--ewu-danger);
  --blue: var(--ewu-blue);
  --shadow-card: var(--ewu-shadow-card);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ewu-paper);
  color: var(--ink);
  font-family: var(--ewu-font);
}

button, input, textarea, select { font: inherit; }

a { color: inherit; }

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 5;
  background: var(--deep);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
}

.skip-link:focus { top: 14px; }

.platform-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.nav-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 74px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -.04em;
  text-decoration: none;
  font-size: 1.18rem;
}

.brand-mark img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-size: .94rem;
  font-weight: 600;
}

.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--ink); }

.hero {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 78px 0 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 800;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -.055em;
  line-height: 1.02;
}

.hero h1 {
  max-width: 790px;
  font-size: clamp(3rem, 7vw, 5.8rem);
}

.hero-text {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.65;
}

.hero-actions, .course-card-top, .section-heading {
  display: flex;
  align-items: center;
}

.hero-actions {
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  box-shadow: var(--shadow-card);
}

.button.primary {
  background: var(--ewu-blue);
  color: #fff;
}

.button.primary:hover:not(:disabled) { background: var(--ewu-blue-dark); }

.button.secondary,
.button.ghost {
  background: #fff;
  color: var(--ink);
}

.button.ghost { box-shadow: rgba(34, 42, 53, .08) 0 0 0 1px; }

.button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.button.disabled {
  pointer-events: none;
  opacity: .55;
}

.hero-card,
.admin-card,
.course-card,
.status-banner {
  background: var(--panel);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
}

.hero-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.hero-card div {
  min-height: 98px;
  padding: 18px;
  border-radius: 18px;
  background: var(--soft);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.hero-card strong {
  font-size: 2.3rem;
  letter-spacing: -.05em;
}

.section-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 32px auto;
  padding: 42px;
  background: #fff;
  border-radius: 30px;
  box-shadow: var(--shadow-card);
}

.section-heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.section-heading p:not(.eyebrow) {
  max-width: 720px;
  color: var(--muted);
  line-height: 1.6;
}

.status-banner {
  padding: 14px 16px;
  color: var(--muted);
  margin-bottom: 18px;
}

.status-banner.success { color: var(--success); }
.status-banner.error { color: var(--danger); }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.course-card {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.course-card-top {
  justify-content: space-between;
  gap: 12px;
}

.date-pill,
.seat-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

.seat-pill.open { color: var(--success); }
.seat-pill.full { color: var(--danger); }

.course-card h3,
.admin-card h3 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -.03em;
}

.course-meta,
.course-description,
.form-note,
.card-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.signup-form,
.admin-card {
  display: grid;
  gap: 14px;
}

.roster-actions {
  display: flex;
  justify-content: flex-end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 750;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 12px 13px;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(23, 102, 160, .7);
  box-shadow: 0 0 0 4px rgba(23, 102, 160, .12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
  gap: 22px;
}

.full-span { grid-column: 1 / -1; }

.admin-card {
  align-self: start;
  padding: 24px;
}

.card-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 4px;
}

.table-shell {
  overflow-x: auto;
  border-radius: 18px;
  box-shadow: rgba(34, 42, 53, .08) 0 0 0 1px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th, td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: .9rem;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip.completed,
.status-chip.certificate-generated,
.status-chip.certificate-sent { color: var(--success); }

.status-chip.cancelled { color: var(--danger); }

.status-control {
  min-width: 190px;
}

.status-control span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.status-control select {
  padding: 8px 10px;
  border-radius: 10px;
}

tr:last-child td { border-bottom: 0; }

.platform-footer {
  width: min(1180px, calc(100vw - 32px));
  margin: 36px auto 52px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.platform-footer a { color: var(--ink); font-weight: 700; }

@media (max-width: 860px) {
  .nav-shell, .section-heading, .hero, .platform-footer { align-items: flex-start; }
  .nav-shell, .hero, .section-heading, .split-section { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 54px; }
  .nav-shell { padding: 14px 0; flex-direction: column; }
  .nav-links { flex-wrap: wrap; }
  .section-shell { padding: 24px; border-radius: 24px; }
  .section-heading { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ */
/* Participant page — compact hero                                      */
/* ------------------------------------------------------------------ */

.hero-compact {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 46px 0 8px;
}

.hero-compact h1 {
  margin: 0;
  max-width: 760px;
  color: var(--ink);
  letter-spacing: -.045em;
  line-height: 1.06;
  font-size: clamp(2.1rem, 4.5vw, 3.3rem);
}

.hero-lede {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ */
/* Participant page — catalog filters                                   */
/* ------------------------------------------------------------------ */

.catalog-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: rgba(34, 42, 53, .14) 0 0 0 1px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 750;
  cursor: pointer;
}

.filter-pill:hover { color: var(--deep); background: var(--soft); }

.filter-pill[aria-pressed="true"] {
  background: var(--soft);
  color: var(--deep);
  box-shadow: none;
}

.filter-status {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .88rem;
}

/* ------------------------------------------------------------------ */
/* Participant page — catalog cards                                     */
/* ------------------------------------------------------------------ */

.course-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.course-purpose {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
}

/* Card CTA opens the course dialog so the grid never reflows. */
.card-cta {
  margin-top: 4px;
  justify-self: start;
}

.course-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(85vh, 100%);
  margin: auto;
  padding: 28px;
  border: 0;
  border-radius: 24px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-card);
  overflow-y: auto;
}

.course-dialog::backdrop {
  background: rgba(31, 42, 51, .5);
}

.course-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.course-dialog-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dialog-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--deep);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.dialog-close:hover { background: var(--ewu-teal-soft); }

.course-dialog-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  letter-spacing: -.03em;
  outline: none;
}

.course-dialog-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .course-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 24px);
    padding: 20px;
    border-radius: 20px;
  }
}

.detail-block { display: grid; gap: 6px; }

.detail-block h4,
.slot-heading {
  margin: 0;
  font-size: .74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
}

.detail-block p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
}

.objective-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.6;
  display: grid;
  gap: 4px;
}

.signup-slot { display: grid; gap: 12px; }

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* Participant page — confirmation panel                                */
/* ------------------------------------------------------------------ */

.confirmation-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 18px;
  background: var(--ewu-success-soft);
}

.confirmation-panel.waitlisted { background: var(--ewu-warning-soft); }

.confirmation-panel h4 {
  margin: 0;
  font-size: 1.16rem;
  letter-spacing: -.02em;
  color: var(--ink);
}

.confirmation-panel p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
}

.next-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  line-height: 1.6;
}

.next-steps .badge {
  white-space: normal;
  line-height: 1.3;
  text-align: left;
}

.calendar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-note {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}

/* Self-service cancel — deliberately quiet next to the primary actions. */
.cancel-line { margin: 0; }

.cancel-link {
  background: none;
  border: 0;
  min-height: 32px;
  padding: 4px 2px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cancel-link:hover,
.cancel-link:focus-visible { color: var(--danger); }

/* Status line shown in place of the confirmation panel after a cancel. */
.cancel-notice {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/* Participant page — recently completed                                */
/* ------------------------------------------------------------------ */

.section-shell.muted-section {
  background: transparent;
  box-shadow: none;
}

.past-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.past-card {
  background: var(--panel);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 20px;
  display: grid;
  gap: 10px;
}

.past-card h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -.02em;
}

.past-card .course-meta { font-size: .9rem; }

@media (max-width: 860px) {
  .hero-compact { padding: 34px 0 4px; }
}
