/* NextStep Demo Harness — Shared Styles */

:root {
  --sage-green: #86A78E;
  --sage-light: #a8c4af;
  --sage-dark: #6b8c73;
  --slate-blue: #435165;
  --slate-dark: #2e3a47;
  --slate-light: #5a6d82;
  --cream: #FCF4E3;
  --cream-dark: #f0e4c8;
  --white: #ffffff;
  --shadow: 0 2px 16px rgba(67, 81, 101, 0.12);
  --shadow-lg: 0 8px 32px rgba(67, 81, 101, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font);
  color: var(--slate-dark);
  background: var(--cream);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* ─── Top Bar ─── */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
  background: var(--slate-blue);
  color: var(--cream);
  font-size: 0.875rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar a {
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity var(--transition);
}

.top-bar a:hover {
  opacity: 0.8;
}

.top-bar__title {
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: 0.01em;
}

.top-bar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── Buttons ─── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  min-height: 44px;
  min-width: 44px;
  text-align: center;
}

.btn-primary {
  background: var(--slate-blue);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--slate-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-outline {
  background: transparent;
  color: var(--slate-blue);
  border-color: var(--slate-blue);
}

.btn-outline:hover {
  background: var(--slate-blue);
  color: var(--cream);
}

.btn-sage {
  background: var(--sage-green);
  color: var(--white);
}

.btn-sage:hover {
  background: var(--sage-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.8125rem;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.15);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  font-size: 0.8125rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 500;
  transition: all var(--transition);
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.25);
}

.btn-copy.copied {
  background: var(--sage-green);
  border-color: var(--sage-green);
}

/* ─── Badge ─── */

.badge-recommended {
  display: inline-block;
  padding: 4px 12px;
  background: var(--sage-green);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 50px;
}

/* ─── Cards ─── */

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
  transition: all var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card--recommended {
  border: 2px solid var(--sage-green);
}

.card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 16px;
  background: var(--cream);
}

.card--recommended .card__icon {
  background: rgba(134, 167, 142, 0.15);
}

.card__badge {
  position: absolute;
  top: 16px;
  right: 16px;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-dark);
  margin-bottom: 8px;
}

.card__description {
  font-size: 0.9375rem;
  color: var(--slate-light);
  margin-bottom: 16px;
  line-height: 1.5;
  flex: 1;
}

.card__setup {
  font-size: 0.8125rem;
  color: var(--sage-dark);
  margin-bottom: 20px;
  font-weight: 500;
}

/* ─── Site Mockup ─── */

.site-mockup {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 52px);
  background-image: url('mosaic-homepage.png');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
}

.site-mockup::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.site-mockup__label {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(67, 81, 101, 0.85);
  color: var(--cream);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 10;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .site-mockup {
    background-image: url('mosaic-homepage-mobile.png');
  }
}

/* ─── Embed Content Card (for iframe view) ─── */

.embed-card {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 720px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.embed-card h2 {
  font-size: 1.125rem;
  color: var(--slate-dark);
  margin-bottom: 16px;
  text-align: center;
}

.embed-card iframe {
  border-radius: var(--radius-sm);
}

/* ─── Code Block ─── */

.code-section {
  background: var(--white);
  padding: 24px;
  border-top: 1px solid var(--cream-dark);
}

.code-section h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-blue);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.code-block {
  background: var(--slate-dark);
  color: #e0e6ed;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

/* ─── Loading State ─── */

.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  z-index: 10;
  transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-overlay__logo {
  width: 120px;
  margin-bottom: 16px;
}

.loading-overlay__text {
  font-size: 0.9375rem;
  color: var(--slate-light);
  font-weight: 500;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--cream-dark);
  border-top-color: var(--sage-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Error Fallback ─── */

.error-fallback {
  display: none;
  text-align: center;
  padding: 40px 20px;
}

.error-fallback.visible {
  display: block;
}

.error-fallback p {
  color: var(--slate-light);
  margin-bottom: 16px;
}

/* ─── Footer CTA ─── */

.footer-cta {
  text-align: center;
  padding: 40px 20px;
  background: var(--slate-blue);
  color: var(--cream);
}

.footer-cta h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.footer-cta p {
  font-size: 0.9375rem;
  opacity: 0.8;
  margin-bottom: 20px;
}

.footer-cta a {
  color: var(--sage-light);
  font-weight: 600;
}

.footer-cta a:hover {
  color: var(--white);
}

/* ─── Widget Pulse (attention hint) ─── */

.widget-pulse {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  z-index: 50;
  pointer-events: none;
}

.widget-pulse::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid var(--sage-green);
  animation: pulse-ring 1.5s ease-out 3;
}

@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ─── Responsive ─── */

@media (max-width: 767px) {
  .top-bar {
    height: 48px;
    padding: 0 12px;
    font-size: 0.8125rem;
  }

  .top-bar__title {
    font-size: 0.8125rem;
  }

  .card {
    padding: 24px 20px;
  }

  .embed-card {
    width: 95%;
    padding: 16px;
    top: 52%;
  }

  .embed-card iframe {
    height: 400px !important;
  }

  .code-block {
    font-size: 0.75rem;
    padding: 12px;
  }
}
