/* ─────────────────────────────────────────────────────────────────────────────
   TEAC³H LMS Styles
   Imports the marketing design system and adds LMS-specific components.
   All --teach3-* variables and .teach3-* classes are available via the import.
   ───────────────────────────────────────────────────────────────────────────── */

@import url('/styles.css');

/* ── LMS page shell ──────────────────────────────────────────────────────────── */

.lms-page {
  min-height: 100vh;
  background: var(--teach3-paper);
  font-family: var(--teach3-font);
  color: var(--teach3-ink);
}

.lms-page-main {
  width: min(calc(100% - 40px), calc(var(--teach3-max) + 80px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.lms-page-main--narrow {
  max-width: 960px;
}

.lms-page-main--compact {
  max-width: 860px;
}

.lms-page-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.lms-page-intro > * {
  min-width: 0;
}

.lms-page-intro--tight {
  margin-bottom: 20px;
}

.lms-page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(88, 141, 131, 0.12);
  color: var(--teach3-teal);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lms-page-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teach3-green);
}

.lms-page-title {
  margin: 0 0 6px;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--teach3-ink);
}

.lms-page-copy {
  margin: 0;
  max-width: 60ch;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--teach3-teal);
}

.lms-page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.lms-card {
  background: var(--teach3-white);
  border: 1px solid rgba(88, 141, 131, 0.12);
  border-radius: var(--teach3-radius);
  box-shadow: var(--teach3-shadow);
}

.lms-card--padded {
  padding: 28px 32px;
}

.lms-card--table {
  overflow: hidden;
}

.lms-card--subtle {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,248,244,0.92));
}

.lms-empty-state {
  max-width: 560px;
  margin-top: 24px;
}

.lms-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lms-inline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lms-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--teach3-line);
  background: var(--teach3-soft);
  color: var(--teach3-teal);
  font-size: 0.88rem;
  line-height: 1.5;
}

.lms-status-banner--warning {
  background: #fef9c3;
  border-color: #fde047;
  color: #713f12;
}

.lms-status-banner--preview {
  background: linear-gradient(135deg, rgba(88, 141, 131, 0.96), rgba(63, 112, 125, 0.94));
  border-color: transparent;
  color: var(--teach3-white);
}

.lms-status-banner--preview a {
  color: inherit;
  font-weight: 700;
}

.lms-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(146, 197, 198, 0.18), transparent 30%),
    radial-gradient(circle at bottom left, rgba(138, 181, 116, 0.14), transparent 32%),
    linear-gradient(180deg, #f9fbf8 0%, #f3f6f2 100%);
  padding: 40px 20px;
}

/* Header bar shared across all LMS pages */
.lms-header {
  background: var(--teach3-white);
  border-bottom: 1px solid var(--teach3-line);
  padding: 14px 40px;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}

.lms-header--app {
  flex-wrap: nowrap;
}

.lms-header__brand {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--teach3-ink);
  letter-spacing: -0.01em;
  text-decoration: none;
  flex-shrink: 0;
}

.lms-header__brand sup {
  font-size: 0.6em;
  vertical-align: super;
}

.lms-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  margin-left: auto;
}

.lms-header__identity {
  min-width: 0;
  flex: 0 1 200px;
}

.lms-header__user {
  font-size: 0.9rem;
  color: var(--teach3-slate);
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lms-header nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-width: 0;
}

.lms-header nav a,
.lms-header__actions a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--teach3-teal);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
  line-height: 1.4;
}

.lms-header nav a:hover,
.lms-header__actions a:hover {
  color: var(--teach3-ink);
}

.lms-header__icon-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.lms-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--teach3-line);
  background: var(--teach3-paper);
  color: var(--teach3-teal);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.lms-icon-button svg {
  width: 20px;
  height: 20px;
}

.lms-icon-button:hover,
.lms-icon-button.is-active {
  background: var(--teach3-white);
  border-color: rgba(63, 112, 125, 0.32);
  color: var(--teach3-ink);
}

.lms-icon-button--small {
  width: 34px;
  height: 34px;
}

.lms-icon-badge {
  position: absolute;
  top: -4px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #b91c1c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border: 2px solid var(--teach3-white);
}

.lms-notification-backdrop {
  position: fixed;
  inset: 0;
  border: none;
  background: rgba(17, 24, 39, 0.28);
  z-index: 35;
}

.lms-notification-panel {
  position: fixed;
  top: 84px;
  right: 24px;
  width: min(360px, calc(100vw - 32px));
  max-height: min(72vh, 620px);
  background: var(--teach3-white);
  border: 1px solid var(--teach3-line);
  border-radius: 20px;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  z-index: 40;
  overflow: hidden;
}

.lms-notification-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(88, 141, 131, 0.12);
}

.lms-notification-panel__kicker {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--teach3-teal);
}

.lms-notification-panel__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--teach3-ink);
}

.lms-notification-panel__body {
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lms-notification-item {
  border: 1px solid rgba(88, 141, 131, 0.12);
  border-radius: 16px;
  padding: 14px 15px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,248,244,0.92));
}

.lms-notification-item__eyebrow {
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teach3-teal);
}

.lms-notification-item__title {
  margin: 0 0 6px;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--teach3-ink);
}

.lms-notification-item__body {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--teach3-slate);
}

.lms-notification-item__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.lms-notification-link,
.lms-notification-dismiss {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teach3-green);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--teach3-font);
}

.lms-notification-dismiss {
  color: var(--teach3-teal);
}

.lms-notification-empty {
  margin: 0;
  padding: 10px 4px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--teach3-teal);
}

.lms-notification-close {
  display: inline-block;
  font-size: 1.3rem;
  line-height: 1;
}

/* ── Two-column shell (dashboard / lesson views) ─────────────────────────────── */

.lms-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 72px);
}

.lms-sidebar {
  background: var(--teach3-white);
  border-right: 1px solid var(--teach3-line);
  padding: 32px 24px;
  min-width: 0;
}

.lms-sidebar__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teach3-teal);
  text-decoration: none;
}

.lms-sidebar__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teach3-teal);
  margin-bottom: 12px;
}

.lms-sidebar__nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lms-sidebar__nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--teach3-slate);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  overflow-wrap: break-word;
}

.lms-sidebar__nav a:hover,
.lms-sidebar__nav a.active {
  background: var(--teach3-soft);
  color: var(--teach3-ink);
  border-color: rgba(88, 141, 131, 0.14);
}

.lms-main {
  padding: 40px 48px;
  max-width: 900px;
}

.lms-breadcrumb {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--teach3-teal);
}

.lms-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.lms-section-card {
  margin-top: 40px;
  padding: 28px 32px;
  border: 1px solid rgba(88, 141, 131, 0.14);
  border-radius: var(--teach3-radius);
  background: var(--teach3-white);
  box-shadow: var(--teach3-shadow);
}

.lms-section-card--accent {
  border-color: rgba(14, 154, 107, 0.32);
  box-shadow: 0 20px 44px rgba(34, 57, 48, 0.08);
}

/* ── Login page layout ───────────────────────────────────────────────────────── */

.lms-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.lms-login-card {
  background: var(--teach3-white);
  border: 1px solid var(--teach3-line);
  border-radius: var(--teach3-radius);
  box-shadow: var(--teach3-shadow);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}

.lms-login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--teach3-green), var(--teach3-mist));
}

.lms-login-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teach3-teal);
}

.lms-login-card__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teach3-green);
}

.lms-login-card__brand {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--teach3-ink);
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

.lms-login-card__brand sup {
  font-size: 0.6em;
  vertical-align: super;
}

.lms-login-card__subtitle {
  font-size: 0.92rem;
  color: var(--teach3-teal);
  margin-bottom: 20px;
}

.lms-login-card__helper {
  margin: 0 0 28px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(88, 141, 131, 0.08);
  color: var(--teach3-slate);
  font-size: 0.86rem;
  line-height: 1.55;
}

/* ── LMS form fields (light background variant) ──────────────────────────────── */
/* The marketing site's form fields are styled for dark/green backgrounds.
   These .lms-field-* classes provide a light-background variant. */

.lms-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.lms-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teach3-slate);
  letter-spacing: 0.01em;
}

.lms-field input,
.lms-field textarea,
.lms-field select {
  font-family: var(--teach3-font);
  font-size: 0.95rem;
  color: var(--teach3-ink);
  background: var(--teach3-paper);
  border: 1px solid var(--teach3-line);
  border-radius: 12px;
  padding: 13px 16px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}

.lms-field input:focus,
.lms-field textarea:focus,
.lms-field select:focus {
  border-color: var(--teach3-teal);
  box-shadow: 0 0 0 3px rgba(63, 112, 125, 0.12);
}

.lms-field input:focus-visible,
.lms-field textarea:focus-visible,
.lms-field select:focus-visible {
  border-color: var(--teach3-teal);
  box-shadow: 0 0 0 3px rgba(63, 112, 125, 0.12);
}

.lms-field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

/* ── Inline error / notice messages ─────────────────────────────────────────── */

.lms-notice {
  font-size: 0.88rem;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: none;
}

.lms-notice--error {
  background: #fff1f1;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.lms-notice--success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.lms-notice.visible {
  display: block;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(14, 154, 107, 0.38);
  outline-offset: 2px;
}

/* ── Progress bar ────────────────────────────────────────────────────────────── */

.lms-progress-bar {
  height: 6px;
  background: var(--teach3-line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.lms-progress-fill {
  height: 100%;
  background: var(--teach3-green);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── Lesson nav (prev / next) ────────────────────────────────────────────────── */

.lms-lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--teach3-line);
}

.lms-lesson-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--teach3-teal);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}

.lms-lesson-nav a:hover {
  color: var(--teach3-green);
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .lms-page-main {
    width: min(calc(100% - 32px), calc(var(--teach3-max) + 80px));
    padding: 32px 0 48px;
  }

  .lms-page-actions {
    justify-content: flex-start;
  }

  .lms-shell {
    grid-template-columns: 1fr;
  }

  .lms-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--teach3-line);
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,248,244,0.94));
  }

  .lms-sidebar__nav {
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
  }

  .lms-main {
    padding: 28px 24px;
  }

  .lms-header {
    padding: 14px 24px;
    align-items: center;
    flex-wrap: wrap;
  }

  .lms-header nav,
  .lms-header__actions {
    width: 100%;
  }

  .lms-header nav {
    order: 3;
    justify-content: flex-start;
    gap: 14px;
  }

  .lms-header__actions {
    order: 2;
    justify-content: space-between;
    gap: 12px;
  }

  .lms-header__identity {
    flex: 1 1 auto;
  }

  .lms-header__user {
    max-width: 100%;
  }

  .lms-header__icon-actions {
    margin-left: auto;
  }

  .lms-notification-panel {
    top: 128px;
    right: 16px;
  }

  .lms-card--padded,
  .lms-section-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .lms-page-main {
    width: min(calc(100% - 24px), calc(var(--teach3-max) + 80px));
    padding: 24px 0 40px;
  }

  .lms-login-card {
    padding: 36px 24px;
  }

  .lms-page-title {
    font-size: 1.55rem;
  }

  .lms-header {
    padding: 12px 16px;
  }

  .lms-header nav {
    gap: 12px;
  }

  .lms-header__actions {
    align-items: center;
    gap: 10px;
  }

  .lms-header__icon-actions {
    gap: 8px;
  }

  .lms-icon-button {
    width: 40px;
    height: 40px;
  }

  .lms-notification-panel {
    top: 116px;
    right: 12px;
    width: calc(100vw - 24px);
    max-height: 68vh;
  }

  .lms-main,
  .lms-sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .lms-status-banner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .teach3-button,
  .teach3-card,
  .lms-course-card,
  .action-btn,
  .lms-progress-fill {
    transition: none !important;
  }

  .teach3-button:hover,
  .teach3-button:focus {
    transform: none;
  }
}
