/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-bg: #f8fafc;
  --color-white: #ffffff;
  --color-border: #e2e8f0;
  --color-success: #16a34a;
  --color-success-bg: #f0fdf4;
  --color-error: #dc2626;
  --color-error-bg: #fef2f2;
  --color-error-border: #fecaca;
  --color-code-bg: #1e293b;
  --color-code-text: #e2e8f0;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.07), 0 4px 16px rgba(0, 0, 0, 0.07);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 2rem 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

p {
  margin-bottom: 0.75rem;
}

ul, ol {
  padding-left: 1.25rem;
}

li {
  margin-bottom: 0.3rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: #f1f5f9;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--color-text);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  background: #f1f5f9;
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ============================================================
   Container
   ============================================================ */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ============================================================
   Site Header
   ============================================================ */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.logo-dot {
  color: var(--color-primary);
}

.logo-sub {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0.1em 0.5em;
  border-radius: 999px;
  border: 1px solid var(--color-border);
}

/* ============================================================
   Progress Bar
   ============================================================ */
.progress-bar {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 0.875rem 0;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.step-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all 0.2s ease;
}

.step-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.step.active .step-num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.step.active .step-label {
  color: var(--color-primary);
  font-weight: 600;
}

.step.done .step-num {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-white);
}

.step.done .step-num::after {
  content: '✓';
  font-size: 0.8rem;
}

.step.done .step-num {
  font-size: 0;
}

.step.done .step-label {
  color: var(--color-success);
}

.step-connector {
  flex: 1;
  min-width: 3rem;
  max-width: 6rem;
  height: 2px;
  background: var(--color-border);
  margin: 0 0.5rem;
  margin-bottom: 1.25rem;
}

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem;
  border: 1px solid var(--color-border);
}

/* ============================================================
   Welcome Card
   ============================================================ */
.welcome-card {
  text-align: center;
}

.welcome-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1;
}

.welcome-card h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* ============================================================
   Feature List
   ============================================================ */
.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  text-align: left;
  margin: 1.5rem 0 2rem;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}

.feature strong {
  display: block;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.feature p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ============================================================
   Prerequisites Box
   ============================================================ */
.prereqs {
  background: var(--color-primary-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-align: left;
  margin-bottom: 2rem;
}

.prereqs h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.prereqs ul {
  margin: 0;
}

.prereqs li {
  font-size: 0.9rem;
  color: var(--color-text);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  font-family: var(--font-sans);
  line-height: 1.4;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-white);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg);
  border-color: #94a3b8;
  color: var(--color-text);
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}

/* ============================================================
   Form
   ============================================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  padding: 0.625rem 3rem 0.625rem 0.875rem;
  font-size: 0.9375rem;
  font-family: var(--font-mono);
  color: var(--color-text);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  font-family: var(--font-sans);
  color: #94a3b8;
}

.form-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.toggle-visibility {
  position: absolute;
  right: 0.625rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s;
}

.toggle-visibility:hover {
  color: var(--color-text);
}

/* ============================================================
   OS Options
   ============================================================ */
.os-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.os-option {
  cursor: pointer;
  flex: 1;
  min-width: 120px;
}

.os-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.os-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.os-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.os-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
}

.os-option:hover .os-card {
  border-color: #93c5fd;
  background: var(--color-primary-light);
}

.os-option input[type="radio"]:checked + .os-card {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.os-option input[type="radio"]:checked + .os-card .os-name {
  color: var(--color-primary);
}

/* ============================================================
   Alert
   ============================================================ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  font-weight: 500;
}

.alert-error {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  color: var(--color-error);
}

/* ============================================================
   Hint Text
   ============================================================ */
.hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* ============================================================
   Instruction Steps
   ============================================================ */
.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.75rem 0;
}

.instruction-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.instruction-num {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.instruction-body {
  flex: 1;
  min-width: 0;
}

.instruction-body h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.instruction-body p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

/* ============================================================
   Code Blocks
   ============================================================ */
.code-block {
  background: var(--color-code-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 0.5rem;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.code-header span {
  font-size: 0.78rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.code-block pre {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--color-code-text);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* ============================================================
   Path Block
   ============================================================ */
.path-block {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-code-bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.875rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.path-block code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--color-code-text);
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

/* ============================================================
   Copy Button
   ============================================================ */
.copy-btn {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--color-white);
}

.copy-btn.copied {
  background: rgba(22, 163, 74, 0.3);
  border-color: rgba(22, 163, 74, 0.5);
  color: #86efac;
}

/* ============================================================
   Success Badge
   ============================================================ */
.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--color-success-bg);
  border: 1px solid #bbf7d0;
  color: var(--color-success);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

/* ============================================================
   Form Actions
   ============================================================ */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ============================================================
   Site Footer
   ============================================================ */
.site-footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
  margin-top: auto;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
  margin: 0;
}

/* ============================================================
   Utility
   ============================================================ */
.hidden {
  display: none !important;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  h1 {
    font-size: 1.4rem;
  }

  .welcome-card h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .os-options {
    flex-direction: column;
  }

  .os-option {
    flex: none;
  }

  .instruction-step {
    gap: 0.75rem;
  }

  .instruction-num {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.8rem;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions .btn {
    width: 100%;
  }

  .steps {
    gap: 0;
  }

  .step-connector {
    min-width: 1.5rem;
  }
}
