/* ============================================================
   COMPONENTS — Buttons, Cards, Badges, Steps, Instructor Cards,
                Lesson Cards, Feature Blocks, Toasts, Overlay
   ============================================================ */

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-base);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn:focus-visible { outline: 3px solid rgba(var(--color-primary-rgb), 0.4); outline-offset: 3px; }

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.30);
}
.btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: 0 6px 24px rgba(var(--color-primary-rgb), 0.40);
  transform: translateY(-1px);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-text);
  border-color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(var(--color-accent-rgb), 0.30);
}
.btn--accent:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn--outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: translateY(-1px);
}

.btn--outline-white {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255,255,255,0.60);
}
.btn--outline-white:hover {
  background: rgba(255,255,255,0.12);
  border-color: var(--color-white);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-mid);
  border-color: var(--color-border);
}
.btn--ghost:hover {
  background: var(--color-light);
  border-color: var(--color-text-muted);
}

.btn--lg {
  font-size: var(--text-base);
  padding: 1.1rem 2.25rem;
  border-radius: var(--radius-xl);
}
.btn--sm {
  font-size: var(--text-xs);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-md);
}
.btn--full { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* ── Step Indicator ───────────────────────────────────────── */
.step-indicator {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-base) var(--space-xl);
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
}
.step-indicator__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.step-indicator__inner::-webkit-scrollbar { display: none; }

.step {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.step__num {
  width: 28px; height: 28px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  background: var(--color-white);
  transition: all var(--transition-base);
  flex-shrink: 0;
}
.step__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  white-space: nowrap;
  transition: color var(--transition-base);
}
.step__connector {
  width: 40px; height: 2px;
  background: var(--color-border);
  margin: 0 var(--space-sm);
  flex-shrink: 0;
  transition: background var(--transition-base);
}

.step.active .step__num {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.35);
}
.step.active .step__label { color: var(--color-primary); font-weight: var(--weight-semibold); }

.step.completed .step__num {
  background: var(--color-success);
  border-color: var(--color-success);
  color: var(--color-white);
}
.step.completed .step__label { color: var(--color-success); }
.step.completed + .step__connector { background: var(--color-success); }

/* ── Instructor Cards ─────────────────────────────────────── */
.instructor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-xl);
}

.instructor-card {
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
}
.instructor-card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}
.instructor-card.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15), var(--shadow-lg);
}
.instructor-card.selected::after {
  content: '\2713';
  position: absolute;
  top: var(--space-base);
  right: var(--space-base);
  width: 28px; height: 28px;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.instructor-card__photo {
  width: 100%;
  aspect-ratio: 3/3.5;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.instructor-card__body {
  padding: var(--space-lg);
}

.instructor-card__badges {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}
.badge--manual {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
}
.badge--auto {
  background: rgba(var(--color-accent-rgb), 0.12);
  color: var(--color-accent-dark);
}
.badge--both {
  background: rgba(5, 150, 105, 0.10);
  color: var(--color-success);
}
.badge--popular {
  background: var(--color-primary);
  color: var(--color-white);
}
.badge--value {
  background: var(--color-accent);
  color: var(--color-text);
}
.badge--fast {
  background: rgba(220, 38, 38, 0.08);
  color: var(--color-error);
}

.instructor-card__name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}
.instructor-card__personality {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  font-style: italic;
  margin-bottom: var(--space-md);
  line-height: var(--leading-snug);
}
.instructor-card__meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.instructor-card__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-mid);
}
.instructor-card__meta-icon { font-size: var(--text-base); }
.instructor-card__areas {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  margin-top: var(--space-xs);
}

.instructor-card__rating {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}
.rating-stars { color: var(--color-accent); font-size: var(--text-sm); letter-spacing: 1px; }
.rating-value { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.rating-count { font-size: var(--text-xs); color: var(--color-text-muted); }

.instructor-card__select-btn {
  width: 100%;
  margin-top: var(--space-md);
}

/* ── Lesson Cards ─────────────────────────────────────────── */
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
}

.lesson-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  border: 2px solid var(--color-border);
  padding: var(--space-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  display: flex;
  flex-direction: column;
}
.lesson-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.lesson-card.selected {
  border-color: var(--color-primary);
  background: var(--color-light-blue);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12), var(--shadow-md);
}

.lesson-card__badge {
  position: absolute;
  top: var(--space-base);
  right: var(--space-base);
}

.lesson-card__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-base);
  line-height: 1;
}
.lesson-card__name {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}
.lesson-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
  flex: 1;
  margin-bottom: var(--space-lg);
}
.lesson-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
}
.lesson-card__price {
  font-size: var(--text-xl);
  font-weight: var(--weight-black);
  color: var(--color-primary);
}
.lesson-card__duration {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}
.lesson-card__suitable {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

/* ── Feature Blocks ───────────────────────────────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-xl);
}

.feature-block {
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-base);
}
.feature-block:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature-block__icon {
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  line-height: 1;
}
.feature-block__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}
.feature-block__desc {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: var(--leading-relaxed);
}

/* ── Stats Strip ──────────────────────────────────────────── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.stats-strip__item {
  background: var(--color-white);
  padding: var(--space-xl);
  text-align: center;
}
.stats-strip__value {
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}
.stats-strip__label {
  font-size: var(--text-sm);
  color: var(--color-text-light);
}

/* ── Testimonial Card ─────────────────────────────────────── */
.testimonial-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.testimonial-card__stars { color: var(--color-accent); font-size: var(--text-base); margin-bottom: var(--space-md); }
.testimonial-card__text {
  font-size: var(--text-base);
  color: var(--color-text-mid);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-lg);
  font-style: italic;
}
.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.testimonial-card__avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-white);
  flex-shrink: 0;
}
.testimonial-card__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text); }
.testimonial-card__detail { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ── CTA Section ──────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  border-radius: var(--radius-2xl);
  padding: var(--space-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-full);
}
.cta-section h2 { font-size: var(--text-2xl); font-weight: var(--weight-extrabold); color: var(--color-white); margin-bottom: var(--space-base); }
.cta-section p { font-size: var(--text-lg); color: rgba(255,255,255,0.80); max-width: 500px; margin: 0 auto var(--space-2xl); }

/* ── W4B Badge ────────────────────────────────────────────── */
.w4b-badge {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 900;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border: 1px solid var(--color-border);
  text-decoration: none;
  transition: all var(--transition-base);
}
.w4b-badge:hover { box-shadow: var(--shadow-xl); transform: translateY(-2px); }
.w4b-badge__label { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.w4b-badge__logo { height: 20px; width: auto; }

/* ── Toast Notifications ──────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-base));
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  pointer-events: all;
  animation: toastIn 0.35s var(--transition-spring) forwards;
  max-width: 360px;
}
.toast--success { background: var(--color-success-bg); color: var(--color-success); border: 1px solid rgba(5,150,105,0.20); }
.toast--error   { background: var(--color-error-bg);   color: var(--color-error);   border: 1px solid rgba(220,38,38,0.20); }
.toast--info    { background: var(--color-light-blue); color: var(--color-primary); border: 1px solid rgba(var(--color-primary-rgb),0.20); }
.toast.removing { animation: toastOut 0.25s ease forwards; }

@keyframes toastIn  { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastOut { from { opacity:1; transform:translateX(0); }    to { opacity:0; transform:translateX(20px); } }

/* ── Loading Overlay ──────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.92);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  backdrop-filter: blur(4px);
}
.loading-overlay.hidden { display: none; }
.loading-spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}
.loading-overlay p { font-size: var(--text-sm); color: var(--color-text-light); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .step__label { display: none; }
  .step__connector { width: 24px; }
  .cta-section { padding: var(--space-2xl) var(--space-lg); }
  .instructor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .w4b-badge { bottom: var(--space-base); right: var(--space-base); }
  .stats-strip { grid-template-columns: 1fr 1fr; }
}
