/* =====================================================
   Spotcheck Playground — Global Styles
   Visual reference: surveysparrow.com (cream + dark navy + teal clouds)
   ===================================================== */

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

:root {
  --bg-cream: #faf6ee;
  --bg-cream-soft: #f4eede;
  --cloud-teal: #c8e6e8;
  --cloud-teal-soft: #e3f1f2;
  --bg-card: #ffffff;
  --card-border: #e8e2d4;
  --card-border-hover: #d5cdb8;

  --navy: #122642;
  --navy-deep: #0a1a30;
  --navy-soft: #1c365e;

  --accent-yellow: #f5c842;
  --accent-yellow-soft: #fff3c8;

  --text-primary: #122642;
  --text-secondary: #4a5568;
  --text-muted: #8a9099;

  --code-bg: #0f1f35;
  --code-text: #e3ecff;
  --code-border: #1f2f4a;

  --shadow-card: 0 4px 18px rgba(18, 38, 66, 0.06);
  --shadow-card-hover: 0 10px 28px rgba(18, 38, 66, 0.10);
  --shadow-btn: 0 4px 14px rgba(18, 38, 66, 0.25);

  --radius-card: 18px;
  --radius-btn: 10px;

  --font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", Consolas, "Courier New", monospace;
}

html, body {
  min-height: 100%;
}

body {
  font-family: var(--font-stack);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-cream);
  position: relative;
  overflow-x: hidden;
}

/* Cloud-like soft wash at the bottom, like surveysparrow.com */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% 100%, var(--cloud-teal) 0%, transparent 60%),
    radial-gradient(ellipse 100% 60% at 80% 110%, var(--cloud-teal-soft) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 50% 95%, var(--cloud-teal) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-cream-soft) 60%, var(--cloud-teal-soft) 100%);
  pointer-events: none;
}

/* =====================================================
   Layout
   ===================================================== */

.page-wrapper {
  width: 100%;
  max-width: 900px;
  padding: 48px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  z-index: 1;
}

/* =====================================================
   Top banner pill (yellow accent like the SurveySparrow announcement bar)
   ===================================================== */

.top-banner {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-yellow-soft);
  border: 1px solid #f1d978;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

.top-banner::before {
  content: "✨";
  font-size: 0.9rem;
}

/* =====================================================
   Cards
   ===================================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--card-border-hover);
}

/* =====================================================
   Hero / Site Header
   ===================================================== */

.site-header {
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;
  padding: 28px 20px 12px;
}

.site-header:hover {
  background: transparent;
  border: none;
  box-shadow: none;
}

.site-header h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--navy);
  line-height: 1.08;
  margin-bottom: 18px;
}

.site-header p.subtitle {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto;
}

/* =====================================================
   Buttons (SurveySparrow style — dark navy primary, outlined secondary)
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-stack);
  font-size: 0.98rem;
  font-weight: 600;
  border: 1.5px solid transparent;
  border-radius: var(--radius-btn);
  padding: 13px 28px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-btn);
  position: relative;
}

.btn-primary:hover {
  background: var(--navy-deep);
  box-shadow: 0 6px 20px rgba(18, 38, 66, 0.32);
}

/* Tiny yellow underline accent like SurveySparrow's "Start free" button */
.btn-primary::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 6px;
  height: 2px;
  background: var(--accent-yellow);
  border-radius: 2px;
  opacity: 0.9;
}

.btn-secondary {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

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

/* =====================================================
   Info / Explanation Section
   ===================================================== */

.info-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
}

.info-section p {
  font-size: 0.96rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.info-section ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-section ul li {
  font-size: 0.94rem;
  color: var(--text-secondary);
  padding-left: 26px;
  position: relative;
}

.info-section ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--accent-yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-yellow-soft);
}

.info-section a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid var(--accent-yellow);
}

.info-section a:hover {
  background: var(--accent-yellow-soft);
}

.info-section code {
  background: #eef0f4;
  color: var(--navy);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* =====================================================
   About SurveySparrow section
   ===================================================== */

.about-ss h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.about-ss .lead {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 28px;
}

.about-ss h3 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 24px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-ss h3::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-yellow);
  box-shadow: 0 0 0 3px var(--accent-yellow-soft);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.feature-item {
  background: var(--bg-cream);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px 18px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.feature-item:hover {
  background: #fff;
  border-color: var(--card-border-hover);
  transform: translateY(-1px);
}

.feature-item h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}

.feature-item p {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.about-ss .closing {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--card-border);
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* =====================================================
   Action Card (CTA)
   ===================================================== */

.action-card {
  text-align: center;
}

.action-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--navy);
}

.action-card p {
  font-size: 0.96rem;
  color: var(--text-secondary);
  margin-bottom: 26px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.btn-group {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 28px;
}

/* =====================================================
   Navigation
   ===================================================== */

.site-nav {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.site-nav a:hover {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.6);
}

.site-nav a.active {
  color: var(--navy);
  background: #fff;
  border-color: var(--card-border);
  font-weight: 600;
}

/* =====================================================
   Code Page — Code Viewer
   ===================================================== */

.code-viewer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.code-viewer label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-textarea {
  width: 100%;
  min-height: 340px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 12px;
  color: var(--code-text);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  padding: 20px 22px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  caret-color: var(--accent-yellow);
}

.code-textarea::placeholder {
  color: var(--text-muted);
}

.code-textarea:focus {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.25);
}

.code-editor-wrap {
  position: relative;
}

.code-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* =====================================================
   Snippet Slot (code.html)
   ===================================================== */

.snippet-slot {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slot-header label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.005em;
}

.slot-header label .req {
  color: #d64545;
  margin-left: 2px;
}

.snippet-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef0f4;
  color: var(--text-muted);
  border: 1px solid #e2e5ec;
}

.snippet-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.snippet-status.is-active {
  background: #e6f7ec;
  color: #1b6b3a;
  border-color: #c0e6cc;
}

.snippet-status.is-active::before {
  background: #2da45e;
  box-shadow: 0 0 0 3px rgba(45, 164, 94, 0.18);
}

.snippet-slot[data-slot="a"] .code-textarea {
  min-height: 500px;
}

.snippet-slot[data-slot="b"] .code-textarea,
.snippet-slot[data-slot="c"] .code-textarea {
  min-height: 250px;
}

.footer-actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

/* =====================================================
   Toast Notification
   ===================================================== */

#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  border: 1px solid var(--navy-soft);
  border-radius: 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 22px;
  box-shadow: 0 10px 30px rgba(18, 38, 66, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================
   Responsive
   ===================================================== */

@media (max-width: 600px) {
  .page-wrapper {
    padding: 32px 16px 64px;
  }

  .card {
    padding: 26px 22px;
  }

  .site-header {
    padding: 20px 16px 8px;
  }

  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .code-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}
