:root {
  /* Nordic Palette */
  --bg: #f6f7f5;
  --text: #2f3435;
  --muted: #6f7b7a;
  --accent: #7bb29e;
  /* Sage Green */
  --accent-hover: #6a9c89;
  --accent-2: #d7e6df;
  /* Light Sage */
  --primary: #9ec2b3;
  /* Soft Blue-Green */
  --border: #d6dbd9;
  --panel: #ffffff;
  --panel-2: #fafbfa;
  --wood: #e9d8c5;
  /* Light Oak */
  --error: #e57373;

  --font-main: ui-sans-serif, -apple-system, "Noto Sans TC", Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
}

/* Layout Utilities */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.hidden {
  display: none !important;
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 700;
  color: var(--text);
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
  font-size: 0.9em;
}

/* Components */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.input,
.select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 14px;
  outline: none;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
}

.label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}

.nav-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-brand img {
  height: 68px;
  width: auto;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.brand-logo img {
  height: 48px;
  width: auto;
}

.brand-logo h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* Steps */
.steps-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.step-pill .idx {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.step-pill.active {
  color: var(--text);
  font-weight: 700;
}

.step-pill.active .idx {
  background: var(--accent);
}

.step-pill.done .idx {
  background: var(--primary);
}

/* Utilities */
.mt-2 {
  margin-top: 8px;
}

.mt-4 {
  margin-top: 16px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-4 {
  margin-bottom: 16px;
}

.section-title {
  margin-bottom: 12px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .container {
    padding: 12px;
  }

  /* Larger touch targets for mobile */
  .btn {
    min-height: 44px;
    padding: 12px 18px;
    font-size: 15px;
  }

  .input,
  .select {
    min-height: 44px;
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  /* Single column on mobile */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Steps navigation - scrollable on mobile */
  .steps-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .steps {
    min-width: max-content;
    padding: 0 12px;
  }

  .step-pill {
    font-size: 12px;
    padding: 6px 10px;
  }

  .step-pill div:not(.idx) {
    display: none;
    /* Hide text on mobile, show only numbers */
  }

  /* Panel spacing */
  .panel {
    padding: 16px;
  }

  .card {
    padding: 12px;
  }

  /* Footer navigation */
  .footer-nav {
    flex-direction: column;
    gap: 12px;
  }

  .footer-nav .row {
    width: 100%;
    justify-content: stretch;
  }

  .footer-nav .btn {
    flex: 1;
  }
}