/* ==========================================================================
   Smartly-Cloudy
   Layered on top of Bootstrap 5.3. Design goals: calm, legible, credible to a
   teacher evaluating whether to trust the platform with their coursework.
   ========================================================================== */

:root {
  --sc-ink:        #12212e;
  --sc-ink-soft:   #46596b;
  --sc-muted:      #6b7f90;
  --sc-line:       #dde5ec;
  --sc-line-soft:  #eef3f7;
  --sc-bg:         #ffffff;
  --sc-bg-soft:    #f5f8fa;
  --sc-bg-tint:    #eef5f9;

  --sc-primary:      #0f6d8f;
  --sc-primary-dark: #0a5570;
  --sc-primary-soft: #e3f1f7;
  --sc-accent:       #d97a20;
  --sc-accent-soft:  #fbeeE1;

  --sc-radius:    12px;
  --sc-radius-sm: 8px;
  --sc-shadow:    0 1px 2px rgba(18, 33, 46, .06), 0 8px 24px rgba(18, 33, 46, .06);
  --sc-shadow-sm: 0 1px 2px rgba(18, 33, 46, .07);

  --bs-primary: #0f6d8f;
}

/* --------------------------------------------------------------- base --- */

html { scroll-behavior: smooth; }

body {
  color: var(--sc-ink);
  background: var(--sc-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.02rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--sc-ink);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -.011em;
}

h1 { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 1.15rem + .8vw, 1.8rem); margin-top: 2.2rem; }
h3 { font-size: 1.2rem; margin-top: 1.7rem; }

a { color: var(--sc-primary); text-underline-offset: .18em; }
a:hover { color: var(--sc-primary-dark); }

img { max-width: 100%; height: auto; }

.btn-primary {
  --bs-btn-bg: var(--sc-primary);
  --bs-btn-border-color: var(--sc-primary);
  --bs-btn-hover-bg: var(--sc-primary-dark);
  --bs-btn-hover-border-color: var(--sc-primary-dark);
  --bs-btn-active-bg: var(--sc-primary-dark);
  --bs-btn-active-border-color: var(--sc-primary-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--sc-primary);
  --bs-btn-border-color: var(--sc-primary);
  --bs-btn-hover-bg: var(--sc-primary);
  --bs-btn-hover-border-color: var(--sc-primary);
}

.btn { border-radius: var(--sc-radius-sm); font-weight: 550; }

.sc-skip {
  position: absolute; top: .5rem; left: .5rem; z-index: 2000;
  background: #fff; padding: .5rem .9rem; border-radius: var(--sc-radius-sm);
  box-shadow: var(--sc-shadow);
}

/* ------------------------------------------------------------- header --- */

.sc-header {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(8px);
  border-bottom: 1px solid var(--sc-line);
  position: sticky; top: 0; z-index: 1030;
}

.sc-header .navbar { padding-top: .55rem; padding-bottom: .55rem; }

.navbar-brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.16rem; color: var(--sc-ink);
  letter-spacing: -.02em;
}
.navbar-brand:hover { color: var(--sc-primary); }

.sc-brand-mark {
  display: inline-grid; place-items: center;
  width: 2.1rem; height: 2.1rem; border-radius: 9px;
  background: linear-gradient(150deg, var(--sc-primary), #1a94b8);
  color: #fff; font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(15, 109, 143, .3);
}

.navbar-nav .nav-link {
  color: var(--sc-ink-soft);
  font-weight: 520;
  padding: .45rem .8rem;
  border-radius: var(--sc-radius-sm);
}
.navbar-nav .nav-link:hover { color: var(--sc-primary); background: var(--sc-bg-soft); }
.navbar-nav .nav-link.active { color: var(--sc-primary); font-weight: 620; background: var(--sc-primary-soft); }

.sc-nav-account .nav-link { color: var(--sc-ink-soft); }
.sc-signin { padding-inline: 1rem; }
.dropdown-menu { border-color: var(--sc-line); box-shadow: var(--sc-shadow); border-radius: var(--sc-radius); }
.dropdown-item { padding-block: .5rem; }

/* --------------------------------------------------------- breadcrumbs --- */

.sc-crumbs {
  background: var(--sc-bg-soft);
  border-bottom: 1px solid var(--sc-line-soft);
  padding: .7rem 0;
  font-size: .89rem;
}
.sc-crumbs .breadcrumb { margin: 0; }
.sc-crumbs .breadcrumb-item a { color: var(--sc-muted); text-decoration: none; }
.sc-crumbs .breadcrumb-item a:hover { color: var(--sc-primary); text-decoration: underline; }
.sc-crumbs .breadcrumb-item.active { color: var(--sc-ink); font-weight: 550; }

/* --------------------------------------------------------------- main --- */

.sc-main { padding: 2.6rem 0 4rem; flex: 1 0 auto; }
.sc-flashes { max-width: 46rem; margin-bottom: 1.5rem; }
.alert { border-radius: var(--sc-radius); border-width: 1px; }

/* --------------------------------------------------------------- hero --- */

.sc-hero {
  background:
    radial-gradient(1100px 420px at 12% -10%, #e6f4fa 0%, rgba(230,244,250,0) 60%),
    linear-gradient(180deg, var(--sc-bg-tint) 0%, #ffffff 100%);
  border-bottom: 1px solid var(--sc-line-soft);
  padding: 4.2rem 0 3.6rem;
}

.sc-hero h1 {
  font-size: clamp(2.1rem, 1.5rem + 2.3vw, 3.15rem);
  letter-spacing: -.025em;
  max-width: 18ch;
}

.sc-hero .sc-hero-lead {
  font-size: clamp(1.06rem, 1rem + .35vw, 1.24rem);
  color: var(--sc-ink-soft);
  max-width: 54ch;
  margin-top: 1.1rem;
}

.sc-eyebrow {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .76rem;
  font-weight: 700;
  color: var(--sc-primary);
  margin-bottom: .6rem;
}

.sc-hero-actions { margin-top: 1.9rem; display: flex; flex-wrap: wrap; gap: .7rem; }

.sc-hero-note {
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--sc-muted);
}

/* -------------------------------------------------------------- prose --- */

.sc-prose { max-width: 68ch; }
.sc-prose > h1:first-child,
.sc-prose > h2:first-child { margin-top: 0; }
.sc-prose p { margin-bottom: 1.15rem; }
.sc-prose ul, .sc-prose ol { margin-bottom: 1.15rem; padding-left: 1.35rem; }
.sc-prose li { margin-bottom: .45rem; }
.sc-prose li > ul, .sc-prose li > ol { margin-top: .45rem; margin-bottom: .3rem; }

.sc-prose blockquote {
  border-left: 3px solid var(--sc-primary);
  background: var(--sc-bg-soft);
  padding: .9rem 1.2rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--sc-radius-sm) var(--sc-radius-sm) 0;
  color: var(--sc-ink-soft);
}
.sc-prose blockquote p:last-child { margin-bottom: 0; }

.sc-figure { margin: 1.8rem 0; }
.sc-figure img { border-radius: var(--sc-radius); box-shadow: var(--sc-shadow); width: 100%; }

.sc-prose hr { margin: 2.4rem 0; border-color: var(--sc-line); opacity: 1; }

.sc-code {
  background: #10222e;
  color: #dbe7ef;
  padding: 1rem 1.15rem;
  border-radius: var(--sc-radius-sm);
  overflow-x: auto;
  font-size: .87rem;
  line-height: 1.6;
  margin: 1.4rem 0;
}
.sc-code code { color: inherit; background: none; padding: 0; }

.sc-prose :not(pre) > code {
  background: var(--sc-primary-soft);
  color: var(--sc-primary-dark);
  padding: .13em .42em;
  border-radius: 5px;
  font-size: .875em;
}

.sc-table { font-size: .95rem; }
.sc-table th {
  background: var(--sc-bg-soft);
  font-weight: 640;
  border-bottom: 2px solid var(--sc-line);
  white-space: nowrap;
}
.sc-table td, .sc-table th { padding: .7rem .85rem; }

/* ------------------------------------------------------------ sidebar --- */

.sc-sidebar {
  position: sticky; top: 5.2rem;
  background: var(--sc-bg-soft);
  border: 1px solid var(--sc-line-soft);
  border-radius: var(--sc-radius);
  padding: 1rem .75rem;
}
.sc-sidebar .nav-link {
  color: var(--sc-ink-soft);
  padding: .5rem .75rem;
  border-radius: var(--sc-radius-sm);
  font-size: .95rem;
  line-height: 1.4;
}
.sc-sidebar .nav-link:hover { background: #fff; color: var(--sc-primary); }
.sc-sidebar .nav-link.active {
  background: #fff; color: var(--sc-primary); font-weight: 620;
  box-shadow: var(--sc-shadow-sm);
}

/* -------------------------------------------------------------- cards --- */

.sc-cards { display: grid; gap: 1.4rem; }
@media (min-width: 768px) { .sc-cards.sc-cards-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .sc-cards.sc-cards-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) and (max-width: 991.98px) { .sc-cards.sc-cards-3 { grid-template-columns: repeat(2, 1fr); } }

.sc-card {
  position: relative;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius);
  overflow: hidden;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.sc-card:hover {
  box-shadow: var(--sc-shadow);
  transform: translateY(-2px);
  border-color: #c9d8e3;
}

.sc-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--sc-bg-soft); }
.sc-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sc-card-body { padding: 1.15rem 1.25rem 1.35rem; flex: 1 0 auto; }
.sc-card-body h3 { margin: 0 0 .5rem; font-size: 1.09rem; line-height: 1.35; }
.sc-card-body h3 a { color: var(--sc-ink); text-decoration: none; }
.sc-card:hover .sc-card-body h3 a { color: var(--sc-primary); }
.sc-card-body p { color: var(--sc-ink-soft); font-size: .94rem; margin: 0; }

.sc-card-meta {
  font-size: .78rem; color: var(--sc-muted);
  text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
  margin-bottom: .45rem;
}

.stretched-link::after { border-radius: var(--sc-radius); }

/* --------------------------------------------------------- feature row --- */

.sc-features { display: grid; gap: 1.6rem; }
@media (min-width: 768px) { .sc-features { grid-template-columns: repeat(3, 1fr); } }

.sc-feature-icon {
  display: inline-grid; place-items: center;
  width: 2.7rem; height: 2.7rem;
  border-radius: 10px;
  background: var(--sc-primary-soft);
  color: var(--sc-primary);
  font-size: 1.25rem;
  margin-bottom: .85rem;
}
.sc-feature h3 { font-size: 1.08rem; margin: 0 0 .45rem; }
.sc-feature p { color: var(--sc-ink-soft); font-size: .95rem; margin: 0; }

/* -------------------------------------------------------------- panel --- */

.sc-panel {
  background: var(--sc-bg-soft);
  border: 1px solid var(--sc-line-soft);
  border-radius: var(--sc-radius);
  padding: 1.5rem;
}

.sc-band {
  background: var(--sc-bg-soft);
  border-top: 1px solid var(--sc-line-soft);
  border-bottom: 1px solid var(--sc-line-soft);
  padding: 3.2rem 0;
  margin: 3.4rem 0;
}

.sc-section-head { max-width: 60ch; margin-bottom: 1.9rem; }
.sc-section-head h2 { margin-top: 0; }
.sc-section-head p { color: var(--sc-ink-soft); margin-bottom: 0; }

/* --------------------------------------------------------------- auth --- */

.sc-auth-wrap {
  max-width: 27rem; margin: 1rem auto 3rem;
}
.sc-auth-card {
  background: #fff;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow);
  padding: 2rem 1.85rem;
}
.sc-auth-card h1 { font-size: 1.5rem; margin-bottom: .4rem; }
.sc-auth-sub { color: var(--sc-muted); font-size: .94rem; margin-bottom: 1.6rem; }

.form-label { font-weight: 570; font-size: .92rem; margin-bottom: .35rem; }
.form-control, .form-select {
  border-color: var(--sc-line);
  border-radius: var(--sc-radius-sm);
  padding: .58rem .8rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--sc-primary);
  box-shadow: 0 0 0 .2rem rgba(15, 109, 143, .14);
}
.form-text { font-size: .84rem; color: var(--sc-muted); }

/* ---------------------------------------------------------- dashboard --- */

.sc-stat-row { display: grid; gap: 1rem; margin-bottom: 2rem; }
@media (min-width: 576px) { .sc-stat-row { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .sc-stat-row { grid-template-columns: repeat(4, 1fr); } }

.sc-stat {
  background: #fff;
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius);
  padding: 1.1rem 1.25rem;
}
.sc-stat-value { font-size: 1.85rem; font-weight: 680; line-height: 1.1; color: var(--sc-ink); }
.sc-stat-label {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--sc-muted); font-weight: 620; margin-top: .3rem;
}

.sc-page-head {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.8rem;
}
.sc-page-head h1 { margin: 0; }
.sc-page-head p { color: var(--sc-ink-soft); margin: .4rem 0 0; }

.sc-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--sc-bg-soft);
  border: 1px dashed var(--sc-line);
  border-radius: var(--sc-radius);
}
.sc-empty i { font-size: 2.2rem; color: var(--sc-muted); display: block; margin-bottom: .8rem; }
.sc-empty h2 { font-size: 1.2rem; margin: 0 0 .4rem; }
.sc-empty p { color: var(--sc-muted); margin: 0 auto 1.2rem; max-width: 40ch; }

.sc-badge {
  display: inline-block;
  font-size: .74rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em;
  padding: .22em .6em; border-radius: 5px;
}
.sc-badge-active   { background: #dcf3e4; color: #1c6b39; }
.sc-badge-draft    { background: #eef3f7; color: #5b6f80; }
.sc-badge-archived { background: #f0e7e7; color: #85504f; }
.sc-badge-admin    { background: var(--sc-accent-soft); color: #8a4a10; }
.sc-badge-educator { background: var(--sc-primary-soft); color: var(--sc-primary-dark); }
.sc-badge-disabled { background: #f4e4e4; color: #93443f; }

/* --------------------------------------------------------- data table --- */

.sc-data-table { background: #fff; border: 1px solid var(--sc-line); border-radius: var(--sc-radius); overflow: hidden; }
.sc-data-table table { margin: 0; }
.sc-data-table thead th {
  background: var(--sc-bg-soft);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--sc-muted); font-weight: 660;
  border-bottom: 1px solid var(--sc-line);
  padding: .7rem .9rem; white-space: nowrap;
}
.sc-data-table tbody td { padding: .8rem .9rem; vertical-align: middle; border-color: var(--sc-line-soft); }
.sc-data-table tbody tr:last-child td { border-bottom: 0; }
.sc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }

/* --------------------------------------------------------- preflight --- */

.sc-check { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 0; border-bottom: 1px solid var(--sc-line-soft); }
.sc-check:last-child { border-bottom: 0; }
.sc-check-icon { flex: 0 0 auto; font-size: 1.15rem; line-height: 1.4; }
.sc-check-pass  .sc-check-icon { color: #1c8a4a; }
.sc-check-warn  .sc-check-icon { color: #b8791b; }
.sc-check-fail  .sc-check-icon { color: #c0392b; }
.sc-check-name  { font-weight: 600; }
.sc-check-detail { color: var(--sc-muted); font-size: .89rem; }

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

.sc-footer {
  background: #10222e;
  color: #a9bfcf;
  padding: 3.2rem 0 1.6rem;
  margin-top: auto;
  font-size: .93rem;
}
.sc-footer-brand {
  display: flex; align-items: center; gap: .55rem;
  color: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: .7rem;
}
.sc-footer-brand .sc-brand-mark { box-shadow: none; }
.sc-footer-tag { color: #8ba6ba; max-width: 34ch; margin: 0; }

.sc-footer-head {
  color: #fff; font-size: .8rem; font-weight: 680;
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .85rem;
}
.sc-footer-links { list-style: none; padding: 0; margin: 0; }
.sc-footer-links li { margin-bottom: .45rem; }
.sc-footer-links a { color: #a9bfcf; text-decoration: none; }
.sc-footer-links a:hover { color: #fff; text-decoration: underline; }

.sc-footer-base {
  border-top: 1px solid rgba(255, 255, 255, .1);
  margin-top: 2.4rem; padding-top: 1.3rem;
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: space-between;
  font-size: .86rem; color: #7f99ad;
}
.sc-footer-base p { margin: 0; }

/* ------------------------------------------------------------- print --- */

@media print {
  .sc-header, .sc-footer, .sc-crumbs, .sc-sidebar { display: none !important; }
  .sc-main { padding: 0; }
  body { font-size: 11pt; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sc-card { transition: none; }
  .sc-card:hover { transform: none; }
}

/* -----------------------------------------------------------------------
   Icons

   Drawn from /icons.svg, a same-origin sprite, rather than the Bootstrap
   Icons webfont this site used to pull from a CDN. `currentColor` means an
   icon still inherits its colour from Bootstrap's text utilities exactly as
   the font-based glyphs did, so .text-primary and friends keep working.
   ----------------------------------------------------------------------- */

svg.bi {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
  flex-shrink: 0;
}

/* The Composer link sits in the account area but is the primary action for a
   signed-in educator, so it reads as a button rather than another menu item. */
.sc-composer-link { margin-right: .5rem; white-space: nowrap; }
@media (max-width: 991.98px) {
  .sc-composer-link { display: inline-block; margin: .5rem 0; }
}

/* -----------------------------------------------------------------------
   Static edition additions: use notice band and the demo sign-in card.
   ----------------------------------------------------------------------- */
.sc-notice {
  background: #fff8e1;
  border-bottom: 1px solid #f1d58a;
  color: #5c4400;
  font-size: .9rem;
  padding: .45rem 0;
}
.sc-notice a { color: inherit; font-weight: 600; }
.sc-demo-card { margin: 1.25rem 0 1.75rem; }
.sc-demo-creds { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .5rem 0 1rem; }
.sc-demo-creds dt { font-weight: 600; }
.sc-demo-creds dd { margin: 0; }
.sc-demo-creds code { font-size: 1rem; user-select: all; }
