/* ==========================================================================
   Front Line Refinement — Global Styles
   ========================================================================== */

:root {
  --bg: #0e1116;
  --bg-alt: #151a21;
  --surface: #1b2129;
  --surface-hover: #232b35;
  --border: #2a323c;
  --text: #e8ebef;
  --text-muted: #9aa4b0;
  --accent: #c9a227;
  --accent-hover: #ddb63a;
  --accent-dim: #7a6520;
  --danger: #d9534f;
  --success: #4caf50;
  --radius: 8px;
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max: 1140px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.35rem; }

p {
  margin: 0 0 1em;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.container.narrow {
  max-width: 800px;
}

.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 1.5em;
}

/* ---- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
}

.brand:hover { color: var(--text); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  border-radius: 6px;
  flex-shrink: 0;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-mark-lg {
  width: 64px;
  height: 64px;
  font-size: 1.15rem;
  margin: 0 auto 16px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.site-nav a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* ---- Hero ----------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 120px 0;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 162, 39, 0.12), transparent 60%),
    var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 600;
}

.hero h1 {
  font-size: 3.2rem;
  margin-bottom: 20px;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto 32px;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: center;
}

.btn-primary {
  background: var(--accent);
  color: #14100a;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #14100a;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn-block {
  display: block;
  width: 100%;
}

/* ---- Feature cards -------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.feature-card h3 {
  color: var(--accent);
}

.feature-card p {
  color: var(--text-muted);
  margin: 0;
}

/* ---- Split / blockquote --------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.split-accent {
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-accent blockquote {
  margin: 0;
  padding: 36px;
  font-size: 1.6rem;
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
}

.about-line blockquote {
  margin: 32px 0 0;
  padding: 28px;
  font-size: 1.4rem;
  text-align: center;
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* ---- Pathway -------------------------------------------------------------- */

.pathway-list {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

.pathway {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.pathway-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #14100a;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pathway h3 { margin-bottom: 0.2em; }
.pathway p { margin: 0; color: var(--text-muted); }

.text-link {
  font-weight: 600;
}

/* ---- Page hero / prose --------------------------------------------------- */

.page-hero {
  padding: 64px 0 32px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% 0%, rgba(201, 162, 39, 0.08), transparent 60%);
}

.page-hero h1 {
  margin-bottom: 0.2em;
}

.prose {
  font-size: 1.05rem;
  color: var(--text);
}

.prose p {
  margin-bottom: 1.25em;
}

.bio-head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #14100a;
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bio-title {
  color: var(--accent);
  margin: 0;
  font-weight: 600;
}

/* ---- Safety rules --------------------------------------------------------- */

.rules {
  display: grid;
  gap: 20px;
  margin-bottom: 32px;
}

.rule {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
}

.rule h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.rule-num {
  color: var(--accent);
  font-weight: 800;
}

.rule ul {
  margin: 0;
  padding-left: 20px;
}

.rule li {
  margin-bottom: 6px;
  color: var(--text-muted);
}

.safety-closing {
  background: var(--surface);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.safety-closing p {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
}

/* ---- Classes -------------------------------------------------------------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.course-card h2 {
  color: var(--accent);
  font-size: 1.5rem;
}

.course-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.coming-soon-badge {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  white-space: nowrap;
}

.course-intro {
  color: var(--text-muted);
}

.course-body {
  color: var(--text);
  margin-top: 12px;
}

.course-prereq {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.92rem;
}

.course-card h4 {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.course-card ul {
  padding-left: 18px;
  color: var(--text-muted);
}

.course-card li {
  margin-bottom: 4px;
}

.course-details {
  margin: 16px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: grid;
  gap: 8px;
}

.course-details > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px;
}

.course-details dt {
  color: var(--text-muted);
  font-weight: 600;
}

.course-details dd {
  margin: 0;
}

.participation {
  margin-top: 56px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.participation ul {
  padding-left: 20px;
}

.participation li {
  margin-bottom: 6px;
}

.disclaimer {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ---- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 48px 0 24px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
}

.footer-brand {
  font-weight: 700;
  margin: 0;
}

.footer-logo {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 12px;
}

.footer-tagline {
  color: var(--text-muted);
  margin: 4px 0 0;
}

.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-muted);
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-bottom p { margin: 0; }

.admin-link {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.admin-link:hover { color: var(--accent); }

/* ---- Error box ------------------------------------------------------------ */

.error-box {
  text-align: center;
  padding: 48px 24px;
}

.error-box h1 {
  font-size: 4rem;
  color: var(--accent);
}

/* ---- Admin ----------------------------------------------------------------- */

.admin-body {
  background: var(--bg);
}

.admin-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.admin-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-nav a {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--accent);
}

.inline-form { display: inline; }

.admin-main {
  padding-top: 32px;
  padding-bottom: 72px;
}

.admin-main.narrow { max-width: 640px; }

.admin-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.admin-username {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}

.admin-sub {
  color: var(--text-muted);
}

.admin-form label {
  display: block;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: 0.95rem;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-main);
}

.admin-form textarea {
  resize: vertical;
  min-height: 120px;
}

.admin-form textarea.mono,
.admin-form input.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- Alerts ---------------------------------------------------------------- */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-error {
  background: rgba(217, 83, 79, 0.15);
  border: 1px solid var(--danger);
  color: #f1a7a4;
}

.alert-success {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid var(--success);
  color: #a5d6a7;
}

/* ---- Tables (admin waivers/calendar) -------------------------------------- */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.admin-table td {
  color: var(--text);
}

.inline-form {
  display: inline;
}

/* ---- Waiver / schedule form extras ---------------------------------------- */

.waiver-notice {
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}

.waiver-notice p {
  margin: 0;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400 !important;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
}

.calendar-list {
  margin-top: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.calendar-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.calendar-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.calendar-list li:last-child {
  border-bottom: none;
}

.muted {
  color: var(--text-muted);
}

/* ---- Slideshow ------------------------------------------------------------ */

.slideshow {
  position: relative;
  width: 100%;
  max-height: 480px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.slideshow .slide {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: cover;
}

.slideshow .slide.active {
  display: block;
}

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.slide-btn.prev { left: 16px; }
.slide-btn.next { right: 16px; }

.slide-dots {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.dot.active {
  background: var(--accent);
}

/* ---- Drag-and-drop dropzone ----------------------------------------------- */

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 20px;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(201, 162, 39, 0.06);
}

.image-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
}

.image-thumb {
  position: relative;
  width: 140px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-thumb .remove-img {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}

/* ---- Events list ----------------------------------------------------------- */

.events-list {
  margin-top: 40px;
}

.event-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.event-item h3 {
  margin-bottom: 0.2em;
}

.event-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---- Rich text editor ------------------------------------------------------ */

.rich-editor {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.rich-toolbar {
  display: flex;
  gap: 4px;
  padding: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.rich-toolbar button {
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  min-width: 32px;
}

.rich-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rich-content {
  min-height: 140px;
  padding: 14px;
  color: var(--text);
  outline: none;
  font-size: 0.95rem;
  line-height: 1.6;
}

.rich-content:focus {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.rich-content p { margin: 0 0 0.75em; }
.rich-content h3 { margin: 1em 0 0.5em; }
.rich-content ul, .rich-content ol { padding-left: 20px; margin: 0 0 0.75em; }

/* ---- Profile picture upload ------------------------------------------------ */

.profile-upload {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 8px;
}

.profile-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-dim);
}

.profile-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

.profile-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Public biography profile photo */
.profile-photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

/* ---- Course editor (form-based) -------------------------------------------- */

.course-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  background: var(--bg);
}

.course-editor h3 {
  color: var(--accent);
  margin-bottom: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---- Admin login ----------------------------------------------------------- */

.admin-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.admin-login-card h1 {
  margin-bottom: 4px;
}

.admin-back {
  margin-top: 20px;
  font-size: 0.9rem;
}

.admin-back a { color: var(--text-muted); }
.admin-back a:hover { color: var(--accent); }

/* ---- Responsive ------------------------------------------------------------ */

@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2.1rem; }
  .hero h1 { font-size: 2.4rem; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    align-items: stretch;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 8px; }

  .brand-tagline { display: none; }
  .section { padding: 48px 0; }
  .hero { padding: 80px 0; }

  .admin-header-inner { flex-direction: column; height: auto; padding: 16px 24px; }
  .admin-nav { justify-content: center; }
}
