/* ============================================================
   Start Coding with Claude — site-wide styles
   Palette:
     primary  #0F766E (deep teal)
     accent   #0E7490 (blue)
     success  #15803D (green)
     bg       #FAFAF7 (warm off-white)
     text     #1E293B (dark slate)
   ============================================================ */

:root {
  --primary: #0F766E;
  --primary-dark: #0B5A54;
  --accent: #0E7490;
  --success: #15803D;
  --bg: #FAFAF7;
  --text: #1E293B;
  --text-soft: #475569;
  --border: #E2E8F0;
  --card: #FFFFFF;
  --callout-teal-bg: #F0FDFA;
  --callout-blue-bg: #ECFEFF;
  --callout-green-bg: #F0FDF4;
  --callout-amber-bg: #FFFBEB;
  --callout-amber-border: #D97706;
  --code-bg: #1E293B;
  --code-text: #E2E8F0;
  --radius: 10px;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: 2.1rem; margin: 0 0 0.75rem; }
h2 { font-size: 1.5rem; margin: 2.5rem 0 0.75rem; }
h3 { font-size: 1.2rem; margin: 2rem 0 0.5rem; }

p { margin: 0 0 1.1rem; }

a { color: var(--accent); }
a:hover { color: var(--primary); }

ul, ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }

img, svg { max-width: 100%; }

.hidden-until-registered { display: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn.btn-success { background: var(--success); }
.btn.btn-success:hover { background: #116230; }
.btn:disabled { opacity: 0.6; cursor: default; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-secondary:hover { background: var(--callout-teal-bg); color: var(--primary-dark); }

/* ---------- Landing page ---------- */

.landing-header {
  background: linear-gradient(150deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  padding: 4.5rem 1.5rem 4rem;
  text-align: center;
}
.landing-header h1 {
  color: #fff;
  font-size: 2.6rem;
  max-width: 800px;
  margin: 0 auto 1rem;
}
.landing-header .tagline {
  font-size: 1.25rem;
  max-width: 640px;
  margin: 0 auto 2rem;
  opacity: 0.95;
}
.landing-header .btn {
  background: #fff;
  color: var(--primary);
  font-size: 1.1rem;
  padding: 0.85rem 2.2rem;
}
.landing-header .btn:hover { background: var(--bg); }

.landing-section {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.landing-section.narrow { max-width: 720px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { margin-top: 0; }
.card .card-icon { width: 44px; height: 44px; margin-bottom: 0.75rem; color: var(--primary); }

/* ---------- Forms ---------- */

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 560px;
  margin: 1.5rem auto;
}
.form-field { margin-bottom: 1.2rem; }
.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.form-field .optional-tag {
  font-weight: 400;
  color: var(--text-soft);
  font-size: 0.9rem;
}
.form-field input[type="email"],
.form-field input[type="text"],
.form-field input[type="tel"],
.form-field select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
}
.form-field input:focus,
.form-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.checkbox-field {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.95rem;
}
.checkbox-field input { margin-top: 0.3rem; }

.form-notice {
  background: var(--callout-blue-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.8rem 1.1rem;
  margin: 0 auto 1.25rem;
  max-width: 560px;
  display: none;
}
.form-notice.show { display: block; }

.form-error {
  color: #B91C1C;
  font-size: 0.95rem;
  margin-top: 0.75rem;
  display: none;
}
.form-error.show { display: block; }

/* ---------- FAQ ---------- */

details.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.25rem;
  margin-bottom: 0.75rem;
}
details.faq-item summary {
  font-weight: 600;
  cursor: pointer;
}
details.faq-item[open] summary { margin-bottom: 0.5rem; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-soft);
  font-size: 0.95rem;
}
.site-footer a { color: var(--text-soft); }

/* ---------- Course layout ---------- */

.course-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.course-topbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
}
.course-topbar .home-link {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
}

.progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.progress-track {
  flex: 1;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--success);
  border-radius: 5px;
  transition: width 0.4s ease;
}
.progress-label {
  font-size: 0.85rem;
  color: var(--text-soft);
  white-space: nowrap;
}

.course-layout {
  display: flex;
  min-height: calc(100vh - 56px);
}

.course-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  position: sticky;
  top: 56px;
  align-self: flex-start;
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}
.course-sidebar h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 0 1.25rem 0.75rem;
}
.module-nav { list-style: none; margin: 0; padding: 0; }
.module-nav li { margin: 0; }
.module-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 3px solid transparent;
}
.module-nav a:hover { background: var(--bg); }
.module-nav a.active {
  border-left-color: var(--primary);
  background: var(--callout-teal-bg);
  font-weight: 600;
}
.module-check {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: transparent;
  background: #fff;
}
.module-check.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.lesson {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 1.5rem 4rem;
}
.lesson-inner { max-width: 760px; margin: 0 auto; }
.lesson-kicker {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

/* ---------- Callouts ---------- */

.callout {
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--callout-teal-bg);
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0;
}
.callout > :last-child { margin-bottom: 0; }
.callout .callout-title {
  font-weight: 700;
  display: block;
  margin-bottom: 0.35rem;
}
.callout.blue { border-color: var(--accent); background: var(--callout-blue-bg); }
.callout.green { border-color: var(--success); background: var(--callout-green-bg); }
.callout.amber { border-color: var(--callout-amber-border); background: var(--callout-amber-bg); }

/* ---------- Term definitions ---------- */

.term {
  border-bottom: 2px dotted var(--accent);
  font-weight: 600;
}

/* ---------- Code & prompt blocks ---------- */

.copy-block {
  position: relative;
  margin: 1.5rem 0;
}
.copy-block pre {
  margin: 0;
  padding: 1.1rem 1.2rem;
  padding-top: 2.6rem;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.copy-block.prompt pre {
  background: var(--callout-teal-bg);
  color: var(--text);
  border: 1px solid var(--primary);
  font-family: inherit;
  font-size: 0.98rem;
}
.copy-block .block-label {
  position: absolute;
  top: 0.6rem;
  left: 1.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
}
.copy-block.prompt .block-label { color: var(--primary); }
.copy-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.6rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid #64748B;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #CBD5E1;
  cursor: pointer;
}
.copy-block.prompt .copy-btn {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.18); }
.copy-block.prompt .copy-btn:hover { background: var(--callout-teal-bg); }
.copy-btn.copied {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff !important;
}

code {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: #EEF2F6;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
pre code { background: none; padding: 0; font-size: inherit; }

/* ---------- OS tabs ---------- */

.os-tabs { margin: 1.5rem 0; }
.os-tab-buttons {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
}
.os-tab-buttons button {
  padding: 0.55rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--text-soft);
  cursor: pointer;
}
.os-tab-buttons button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.os-panel { display: none; padding-top: 0.5rem; }
.os-panel.active { display: block; }

/* ---------- Accordion (troubleshooting) ---------- */

details.accordion {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  margin-bottom: 0.6rem;
}
details.accordion summary { font-weight: 600; cursor: pointer; }
details.accordion[open] summary { margin-bottom: 0.5rem; }

/* ---------- Quiz ---------- */

.quiz {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.quiz fieldset { border: none; margin: 0 0 1.4rem; padding: 0; }
.quiz legend { font-weight: 700; margin-bottom: 0.5rem; padding: 0; }
.quiz label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.35rem 0;
  cursor: pointer;
}
.quiz input[type="radio"] { margin-top: 0.35rem; }
.quiz-feedback {
  display: none;
  margin-top: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.quiz-feedback.correct {
  display: block;
  background: var(--callout-green-bg);
  border: 1px solid var(--success);
}
.quiz-feedback.incorrect {
  display: block;
  background: var(--callout-amber-bg);
  border: 1px solid var(--callout-amber-border);
}

/* ---------- Lesson footer nav ---------- */

.lesson-actions {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.complete-state {
  display: none;
  color: var(--success);
  font-weight: 700;
}
.complete-state.show { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ---------- Certificate ---------- */

.certificate {
  background: #fff;
  border: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 720px;
  margin: 2rem auto;
}
.certificate .cert-badge { width: 72px; height: 72px; color: var(--success); margin-bottom: 1rem; }
.certificate h2 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-soft);
}
.certificate .cert-course {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  margin: 0.25rem 0 1.5rem;
}
.certificate .cert-company {
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: 2px solid var(--border);
  display: inline-block;
  padding: 0 2rem 0.4rem;
  margin-bottom: 0.5rem;
}
.certificate .cert-date { color: var(--text-soft); }

.reset-link {
  color: var(--text-soft);
  font-size: 0.85rem;
}

/* ---------- Print (certificate) ---------- */

@media print {
  body { background: #fff; }
  .course-topbar,
  .course-sidebar,
  .no-print,
  .site-footer { display: none !important; }
  .lesson { padding: 0; }
  .certificate {
    border-width: 4px;
    margin: 2rem auto;
    page-break-inside: avoid;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 820px) {
  body { font-size: 17px; }
  .landing-header h1 { font-size: 2rem; }
  .sidebar-toggle { display: inline-block; }
  .course-layout { position: relative; }
  .course-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    z-index: 20;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
  }
  .course-sidebar.open { transform: translateX(0); }
  .lesson { padding: 1.75rem 1.1rem 3rem; }
}
