/* ============================================
   Part 1 - Session-Based Auth & REST API
   Stylesheet
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f172a;
  --bg-2: #1e293b;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --accent: #06b6d4;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Sarabun', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface-2);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============ Hero ============ */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #06b6d4 100%);
  color: #fff;
  padding: 64px 0 56px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.subtitle {
  font-size: 1.05rem;
  max-width: 720px;
  opacity: 0.95;
  margin-bottom: 28px;
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-nav a {
  color: #fff;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.quick-nav a:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

/* ============ Section ============ */
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin: 28px 0;
  box-shadow: var(--shadow);
}

.section h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section h2::before {
  content: '';
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 2px;
}

.section-desc {
  color: var(--text-muted);
  margin-bottom: 22px;
  font-size: 0.95rem;
}

/* ============ Q&A ============ */
.qa {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.qa:hover {
  border-color: var(--primary);
}

.qa[open] {
  background: var(--primary-light);
  border-color: var(--primary);
}

.qa summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  transition: color 0.2s ease;
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary::after {
  content: '+';
  margin-left: auto;
  font-size: 1.4rem;
  color: var(--primary);
  transition: transform 0.2s ease;
}

.qa[open] summary::after {
  transform: rotate(45deg);
}

.q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.qa-body {
  padding: 0 20px 20px 60px;
  font-size: 0.95rem;
  color: #334155;
}

.qa-body p {
  margin-bottom: 10px;
}

.qa-body ul {
  margin: 8px 0 14px 20px;
}

.qa-body li {
  margin-bottom: 4px;
}

.qa-body code {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

/* ============ Zip Download Card ============ */
.zip-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--primary-light) 0%, #fdf4ff 100%);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.zip-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #e0e7ff 0%, #fae8ff 100%);
}

.zip-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.35);
}

.zip-info {
  flex: 1;
  min-width: 0;
}

.zip-name {
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.zip-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.zip-btn {
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.zip-card:hover .zip-btn {
  background: var(--primary-dark);
}

/* ============ Commands ============ */
.cmd-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cmd-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cmd-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.cmd-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.copy-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.copy-btn.copied {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}

.cmd-card pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 0.95rem;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

.cmd-card pre code {
  font-family: inherit;
}

.cmd-note {
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.cmd-note code {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.cmd-extra {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.cmd-extra h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: var(--text);
}

.cmd-card.small pre {
  font-size: 0.88rem;
  padding: 12px 16px;
}

/* ============ Part 2 Requirements ============ */
.section.part2 {
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
  border-color: #fde68a;
}

.section.part2 h2::before {
  background: linear-gradient(180deg, #f59e0b, #ef4444);
}

.req {
  margin-bottom: 22px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.req:last-child {
  margin-bottom: 0;
}

.req-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.req-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.req-head h3 {
  font-size: 1.15rem;
  color: var(--text);
}

.req-intro {
  margin-bottom: 14px;
  color: var(--text-muted);
}

.req-list {
  list-style: none;
}

.req-list > li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-bottom: 1px dashed var(--border);
  font-size: 0.95rem;
}

.req-list > li:last-child {
  border-bottom: none;
}

.req-list > li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 10px;
  color: var(--primary);
  font-weight: 700;
}

.req-list code {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

.sub-list {
  margin: 8px 0 0 18px;
  list-style: disc;
  color: var(--text-muted);
}

.sub-list li {
  margin: 4px 0;
}

.inline-cmd {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.inline-cmd pre {
  flex: 1;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  overflow-x: auto;
}

.inline-cmd .copy-btn {
  align-self: stretch;
}

.api-table {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.api-file {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.api-path {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 10px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 6px;
  margin-bottom: 12px;
  display: inline-block;
}

.api-file ul {
  list-style: none;
}

.api-file li {
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.method {
  display: inline-block;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  min-width: 76px;
  text-align: center;
  letter-spacing: 0.3px;
}

.method.get {
  background: #dbeafe;
  color: #1e40af;
}

.method.post {
  background: #dcfce7;
  color: #166534;
}

.method.put {
  background: #fef3c7;
  color: #92400e;
}

.method.delete {
  background: #fee2e2;
  color: #991b1b;
}

.btn {
  border: 