/* ============================================================================
 * styles.css — Training Feedback dashboard
 *
 * Brand tokens, fonts, a11y base, and button/footer primitives come from
 * vendor/caes-theme.css (ported from @caes-webteam/ui@0.3.0). This file:
 *   1. maps the app's local var names onto the brand tokens,
 *   2. hand-ports the CAES AppHeader + Footer chrome to plain CSS, and
 *   3. styles the app's own content (cards, form, QR, print flyer).
 * ==========================================================================*/
:root {
  /* Local names kept for the app's existing rules, now pointed at brand tokens */
  --uga-red: var(--color-bulldog-red);
  --uga-red-dark: var(--color-bulldog-red-dark);
  --ink: var(--color-text-primary);
  --muted: var(--color-text-secondary);
  --line: var(--color-medium-gray);
  --bg: var(--color-light-gray);
  --card: var(--theme-surface);
}

* { box-sizing: border-box; }
/* the [hidden] attribute must win over class-based display rules below */
[hidden] { display: none !important; }

/* Sticky footer: header / intro / main / footer stack; main grows. */
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* ============================================================================
 * CAES brand chrome — hand-ported from @caes-webteam/ui@0.3.0 (AppHeader,
 * UgaBar, Footer). Tailwind utility classes translated to plain CSS against the
 * brand tokens. Centered band content shares the app's 980px content width.
 * ==========================================================================*/
.caes-chrome-inner { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* ---- header (shadow-lg over the two black bands) ---- */
.caes-header { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }

/* UGA institutional bar */
.caes-ugabar {
  background: var(--color-arch-black);
  color: var(--color-chapel-bell-white);
  border-bottom: 2px solid var(--color-bulldog-red);
}
.caes-ugabar__inner {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding-top: .375rem; padding-bottom: .375rem;
}
.caes-ugabar__home { flex-shrink: 0; display: inline-flex; border-radius: .25rem; }
.caes-wordmark { display: inline-flex; line-height: 0; height: .5rem; color: var(--color-chapel-bell-white); }
.caes-wordmark svg { display: block; height: 100%; width: auto; }
.caes-ugabar__unit {
  display: none;
  font-family: var(--font-sans);
  font-size: .75rem;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  transition: color .15s;
}
.caes-ugabar__unit:hover { color: #fff; text-decoration: underline; }
@media (min-width: 640px) { .caes-ugabar__unit { display: block; } }

/* Brand row: signature | divider | app title */
.caes-brandrow { background: var(--color-arch-black); color: var(--color-chapel-bell-white); }
.caes-brandrow__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  column-gap: 1rem; row-gap: .5rem;
  padding-top: .75rem; padding-bottom: .75rem;
}
.caes-brandrow__left { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.caes-brandrow__logo { flex-shrink: 0; display: inline-flex; border-radius: .375rem; }
.caes-signature { display: block; height: 2rem; width: auto; }
@media (min-width: 640px) { .caes-signature { height: 2.5rem; } }
.caes-brandrow__divider { height: 1.5rem; width: 1px; flex-shrink: 0; background: rgba(255,255,255,.3); }
.caes-brandrow__title { min-width: 0; text-decoration: none; color: inherit; border-radius: .375rem; }
.caes-brandrow__title > span {
  display: block; font-family: var(--font-heading);
  font-size: 1rem; font-weight: 700; letter-spacing: .025em; line-height: 1.25; margin: 0;
  color: var(--color-chapel-bell-white);
}
@media (min-width: 640px) { .caes-brandrow__title > span { font-size: 1.125rem; } }

/* ---- page intro (compact, light — the page's descriptive h1) ---- */
.page-intro { padding: 22px 0 0; }
.page-intro h1 { margin: 0; font-size: 1.3rem; letter-spacing: .2px; color: var(--ink); }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }

/* ============================================================================
 * App content
 * ==========================================================================*/
.layout {
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding-top: 26px;
  padding-bottom: 40px;
  align-items: start; /* each card sizes to its own content (no dead space) */
}
@media (max-width: 760px) { .layout { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--theme-radius-card);
  padding: 22px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.card h2 { margin: 0 0 16px; font-size: 1.15rem; }

.field { display: block; margin-bottom: 16px; }
.field > span, .legend { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.field input[type="text"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--theme-radius-base);
  font: inherit;
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--uga-red);
  box-shadow: 0 0 0 3px rgba(186,12,47,.12);
}
fieldset.field { border: 1px solid var(--line); border-radius: var(--theme-radius-base); padding: 12px 14px; }
.inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 18px; font-weight: 500; }
fieldset .inline + input[type="date"] { margin-top: 10px; }

.warning {
  background: #fff8e6;
  border: 1px solid #f0d68a;
  color: #7a5b00;
  padding: 10px 12px;
  border-radius: var(--theme-radius-base);
  font-size: .88rem;
  margin: 4px 0 0;
}

.output-card { text-align: center; }
.qr-box {
  display: inline-block;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
#qrCanvas { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.print-caption { font-weight: 600; margin: 14px 0 4px; }

.output-card .field { text-align: left; margin-top: 16px; }
textarea#linkOut { resize: vertical; font-family: var(--font-mono), ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }

/* Buttons — CAES button aesthetic (uppercase, heading font, AA contrast). */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
button, .btn-link {
  appearance: none;
  border: 1px solid var(--uga-red);
  background: var(--uga-red);
  color: #fff;
  font-family: var(--font-heading);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: var(--theme-radius-button);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .15s, color .15s;
}
button:hover, .btn-link:hover { background: var(--uga-red-dark); border-color: var(--uga-red-dark); }
.btn-link { background: #fff; color: var(--uga-red); }
.btn-link:hover { background: #fdeef1; color: var(--uga-red-dark); }

.copy-msg { color: #1a7f37; font-weight: 600; margin: 10px 0 0; }

/* ============================================================================
 * CAES dark footer — hand-ported from @caes-webteam/ui@0.3.0 (Footer).
 * ==========================================================================*/
.caes-footer {
  margin-top: auto;
  background: var(--color-arch-black);
  color: var(--color-chapel-bell-white);
}
.caes-footer__inner { padding-top: 2rem; padding-bottom: 2rem; }
.caes-footer__cols { display: grid; gap: 2rem; }
@media (min-width: 640px) { .caes-footer__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .caes-footer__cols { gap: 3rem; } }
.caes-footer__sig-link { display: inline-block; border-radius: .25rem; }
.caes-footer__sig { display: block; height: 3rem; width: auto; }
@media (min-width: 640px) { .caes-footer__sig { height: 3.5rem; } }
.caes-footer__head {
  margin: 0; font-family: var(--font-heading); font-size: .875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--color-chapel-bell-white);
}
.caes-footer__text { margin: .5rem 0 0; font-size: .875rem; color: rgba(255,255,255,.7); }
.caes-footer__text a { color: var(--color-chapel-bell-white); }
.caes-footer__list { margin: .5rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .375rem; }
.caes-footer__link {
  font-size: .875rem; color: var(--color-chapel-bell-white);
  text-decoration: underline; text-underline-offset: 2px;
}
.caes-footer__link:hover { color: rgba(255,255,255,.8); }
.caes-footer__link--med { font-weight: 500; }
.caes-footer__bottom {
  margin-top: 2rem; display: flex; flex-direction: column; gap: .25rem;
  border-top: 1px solid rgba(255,255,255,.15); padding-top: 1rem;
  font-size: .75rem; color: rgba(255,255,255,.7);
}
.caes-footer__bottom p { margin: 0; }
@media (min-width: 640px) {
  .caes-footer__bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- print: clean flyer with big QR + caption + link ---------- */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; display: block; }
  .layout { display: block; padding: 0; }
  .output-card { border: none; box-shadow: none; text-align: center; }
  #qrCanvas { width: 360px; height: 360px; }
  .print-caption { font-size: 1.3rem; margin-top: 22px; }
  /* show the URL under the QR on the printed page */
  .output-card::after {
    content: attr(data-print-url);
    display: block;
    margin-top: 10px;
    font-size: .8rem;
    word-break: break-all;
    color: #333;
  }
}
