/* ============================================================
   GSE Curriculum Planning — Stanford Design Layer
   Tokens and patterns ported from program-proposal-dashboard
   ============================================================ */

/* ----------------------------------------------------------
   1. Design Tokens
   ---------------------------------------------------------- */
:root {
  /* Primary brand */
  --cardinal: #8c1515;
  --cardinal-dark: #820000;
  --cardinal-light: #b83a4b;

  /* Neutrals */
  --gse-black: #2e2d29;
  --gse-gray: #e4e4e3;
  --gse-gray-mid: #767674;
  --gse-gray-light: #f7f7f6;
  --white: #ffffff;

  /* Accents */
  --gse-blue: #adcfe2;
  --gse-blue-deep: #1e6b8a;
  --palo-alto: #175e54;
  --poppy: #e98300;

  /* Semantic */
  --color-error: #dc2626;
  --color-success: #175e54;
}

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

body {
  font-family:
    "Source Sans 3",
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--gse-black);
  background-color: var(--gse-gray-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----------------------------------------------------------
   2. Stanford Utility Bar
   ---------------------------------------------------------- */
.su-brand-bar {
  background: #2e2d29;
  padding: 6px 24px;
}
.su-brand-bar__link {
  font-family: "Source Sans 3", sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #9d9c97;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.su-brand-bar__link:hover {
  color: var(--gse-blue);
}

/* ----------------------------------------------------------
   3. GSE Wordmark Header
   ---------------------------------------------------------- */
.gse-header {
  background: var(--white);
  border-bottom: 1px solid var(--gse-gray);
  padding: 14px 24px;
}
.gse-wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gse-wordmark__stanford {
  font-family: "Source Serif 4", serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--cardinal);
  letter-spacing: -0.01em;
  line-height: 1;
}
.gse-wordmark__separator {
  width: 1px;
  height: 40px;
  background: var(--gse-gray);
  flex-shrink: 0;
}
.gse-wordmark__unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--gse-black);
  line-height: 1.3;
  text-decoration: none;
}
.gse-wordmark__unit:hover {
  animation: wordmark-pulse 1s ease-in-out infinite;
}
@keyframes wordmark-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

@media (max-width: 640px) {
  .gse-wordmark__stanford {
    font-size: 22px;
  }
  .gse-wordmark__separator {
    height: 28px;
  }
  .gse-wordmark__unit {
    font-size: 12px;
  }
}

/* ----------------------------------------------------------
   4. Cardinal Navigation Bar
   ---------------------------------------------------------- */
.gse-nav {
  background: var(--cardinal);
  min-height: 48px;
}
.gse-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  min-height: 48px;
}
.gse-nav__brand {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.gse-nav__brand:hover {
  color: #ffffff;
}
.gse-nav__right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.gse-nav__user {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
.gse-nav__link {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 3px;
  transition: background 0.12s ease;
}
.gse-nav__link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
/* Logout form: remove default block layout so it sits inline with the user name */
.gse-nav__logout-form {
  display: inline;
}
/* Logout is a POST form button — reset browser button styles to match the link */
.gse-nav__link--button {
  background: none;
  border: none;
  cursor: pointer;
}
@media (max-width: 640px) {
  .gse-nav__user {
    display: none;
  }
}

/* ----------------------------------------------------------
   5. Main Content Area
   ---------------------------------------------------------- */
.gse-main {
  flex: 1;
  background: var(--gse-gray-light);
  padding-bottom: 48px;
}
.gse-main .container {
  padding-top: 0;
}

/* ----------------------------------------------------------
   6. Hero Section
   ---------------------------------------------------------- */
.gse-hero {
  background: linear-gradient(
    155deg,
    rgba(140, 21, 21, 0.97) 0%,
    rgba(80, 10, 10, 0.99) 55%,
    rgba(46, 45, 41, 1) 100%
  );
  padding: 80px 24px 72px;
  overflow: hidden;
}
.gse-hero__inner {
  max-width: 720px;
  margin: 0 auto;
}
.gse-hero__eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gse-blue);
  margin-bottom: 16px;
}
.gse-hero__title {
  font-family: "Source Serif 4", serif;
  font-size: 52px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 20px;
}
.gse-hero__subtitle {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.65;
  max-width: 540px;
  margin-bottom: 36px;
}
@media (max-width: 640px) {
  .gse-hero {
    padding: 48px 16px 44px;
  }
  .gse-hero__title {
    font-size: 36px;
  }
  .gse-hero__subtitle {
    font-size: 16px;
  }
}

/* ----------------------------------------------------------
   7. Page Header
   ---------------------------------------------------------- */
.gse-page-header {
  padding: 40px 0 24px;
  margin-bottom: 8px;
}
.gse-page-header__eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cardinal);
  margin-bottom: 8px;
}
.gse-page-header__title {
  font-family: "Source Serif 4", serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  color: var(--gse-black);
  margin-bottom: 8px;
}
.gse-page-header__subtitle {
  font-size: 15px;
  color: var(--gse-gray-mid);
  line-height: 1.55;
}
@media (max-width: 640px) {
  .gse-page-header {
    padding: 24px 0 16px;
  }
}

/* ----------------------------------------------------------
   8. Cards
   ---------------------------------------------------------- */
.gse-card {
  background: var(--white);
  border: 1px solid var(--gse-gray);
  border-top: 3px solid var(--cardinal);
  border-radius: 4px;
  padding: 28px 32px;
  margin-bottom: 24px;
}
.gse-card--error {
  border-top-color: var(--color-error);
}
.gse-card--success {
  border-top-color: var(--color-success);
}
.gse-card--muted {
  border-top-color: var(--gse-gray);
}
.gse-card__title {
  font-family: 'Source Serif 4', serif;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}
.gse-card__body {
  font-size: 15px;
  color: var(--gse-gray-mid);
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .gse-card {
    padding: 20px 16px;
  }
}

/* ----------------------------------------------------------
   9. Buttons
   ---------------------------------------------------------- */
.btn-cardinal {
  background: var(--cardinal);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 10px 24px;
  font-family: "Source Sans 3", sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease;
  line-height: 1.4;
}
.btn-cardinal:hover,
.btn-cardinal:focus {
  background: var(--cardinal-dark);
  color: #ffffff;
}
.btn-cardinal:disabled {
  background: var(--gse-gray-mid);
  cursor: not-allowed;
}
.btn-ghost {
  background: transparent;
  color: var(--cardinal);
  border: 1px solid var(--cardinal);
  border-radius: 4px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s ease;
}
.btn-ghost:hover {
  background: var(--cardinal);
  color: #ffffff;
}
@media (max-width: 480px) {
  .btn-cardinal.btn-block {
    width: 100%;
    text-align: center;
  }
}

/* ----------------------------------------------------------
   10. Form Labels + Help Text
   ---------------------------------------------------------- */
.gse-form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gse-black);
  display: block;
  margin-bottom: 6px;
}
.gse-form-help {
  font-size: 13px;
  color: var(--gse-gray-mid);
  margin-top: 5px;
  margin-bottom: 0;
}
.gse-form-group {
  margin-bottom: 24px;
}

/* ----------------------------------------------------------
   11. Download List (results page)
   ---------------------------------------------------------- */
.gse-download-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.gse-download-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--gse-gray);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.gse-download-list li:last-child {
  border-bottom: none;
}
.gse-download-list a {
  color: var(--cardinal);
  font-weight: 600;
  text-decoration: none;
}
.gse-download-list a:hover {
  text-decoration: underline;
}
.gse-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gse-gray-mid);
  margin: 20px 0 8px;
}
.gse-final-download {
  background: var(--gse-gray-light);
  border: 1px solid var(--gse-gray);
  border-left: 3px solid var(--cardinal);
  border-radius: 4px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.gse-final-download__name {
  font-weight: 600;
  font-size: 15px;
  color: var(--gse-black);
}

/* ----------------------------------------------------------
   12. Alert Banners
   ---------------------------------------------------------- */
.gse-alert {
  border-radius: 4px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.gse-alert--success {
  background: #f0fdf4;
  color: var(--color-success);
  border: 1px solid #bbf7d0;
}
.gse-alert--error {
  background: #fef2f2;
  color: var(--color-error);
  border: 1px solid #fecaca;
}

/* ----------------------------------------------------------
   13. Processing Spinner
   ---------------------------------------------------------- */
.gse-spinner {
  display: none;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--gse-gray-mid);
  margin-top: 16px;
}
.gse-spinner.visible {
  display: flex;
}
.gse-spinner__dots {
  display: flex;
  gap: 4px;
}
.gse-spinner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gse-gray-mid);
  animation: gse-pulse 1.2s infinite ease-in-out;
}
.gse-spinner__dot:nth-child(2) {
  animation-delay: 0.2s;
}
.gse-spinner__dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes gse-pulse {
  0%,
  80%,
  100% {
    transform: scale(0.7);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ----------------------------------------------------------
   14. Footer
   ---------------------------------------------------------- */
.gse-footer {
  background: var(--gse-black);
  padding: 40px 24px;
  margin-top: auto;
}
.gse-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gse-footer__wordmark-stanford {
  font-family: "Source Serif 4", serif;
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
}
.gse-footer__wordmark-unit {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 10px;
  text-decoration: none;
}
.gse-footer__wordmark-unit:hover {
  animation: wordmark-pulse 1s ease-in-out infinite;
}
.gse-footer__copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
}

/* ----------------------------------------------------------
   15. Back link
   ---------------------------------------------------------- */
.gse-back-link {
  font-size: 14px;
  color: var(--cardinal);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 8px;
}
.gse-back-link:hover {
  color: var(--cardinal-dark);
  text-decoration: underline;
}
