:root {
  --rf-blue: #1A4FED;
  --rf-blue-hover: #1240C8;
  --navy: #0F2A66;
  --text-dark: #1A1A1A;
  --text-muted: #4A4A4A;
  --divider: #E3E8F4;
  --card-bg: #FFFFFF;
  --hero-gradient: linear-gradient(135deg, #1A4FED 0%, #0D2F9E 100%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  min-height: 100%;
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F7FE 40%, #EDF2FC 100%);
  background-attachment: fixed;
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

h1, h2, h3, .brand {
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

a {
  color: var(--rf-blue);
}

/* ---------- Header ---------- */

.site-header {
  background: var(--hero-gradient);
  color: #fff;
  padding: 40px 20px 48px;
  text-align: center;
  position: relative;
}

.back-to-rf {
  position: absolute;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.12s ease, border-color 0.12s ease;
}

.back-to-rf:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 600px) {
  .site-header {
    padding-top: 64px;
  }
}

.site-header .brand {
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  font-weight: 800;
  margin: 0;
}

.site-header .tagline {
  margin: 10px auto 0;
  max-width: 560px;
  font-size: 1.05rem;
  opacity: 0.95;
}

.header-home-link {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* ---------- Search ---------- */

.search-wrap {
  max-width: 620px;
  margin: -26px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

#search {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  padding: 14px 20px;
  border-radius: 999px;
  border: 2px solid var(--rf-blue);
  box-shadow: 0 8px 24px rgba(26, 79, 237, 0.18);
  outline: none;
}

#search:focus {
  border-color: var(--rf-blue-hover);
  box-shadow: 0 8px 28px rgba(26, 79, 237, 0.3);
}

/* ---------- Filter tabs ---------- */

.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 620px;
  margin: 18px auto 0;
  padding: 0 20px;
}

.tab-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--divider);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}

.tab-btn:hover {
  border-color: var(--rf-blue);
  color: var(--rf-blue);
}

.tab-btn.active {
  background: var(--rf-blue);
  border-color: var(--rf-blue);
  color: #fff;
}

.no-results {
  display: none;
  text-align: center;
  color: var(--text-muted);
  padding: 30px 20px;
}

.no-results.visible {
  display: block;
}

/* ---------- Layout ---------- */

.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 34px 20px 80px;
}

.section-title {
  font-size: 1.35rem;
  color: var(--navy);
  margin: 38px 0 18px;
}

/* ---------- FloKit banner ---------- */

.flokit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(
    120deg,
    #9C4DC8 0%,
    #C44E8C 25%,
    #EE7059 50%,
    #F4A24D 65%,
    #C44E8C 85%,
    #9C4DC8 100%
  );
  background-size: 250% 100%;
  animation: flokit-shimmer 9s ease-in-out infinite;
  color: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  margin: 30px 0 6px;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(196, 78, 140, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.flokit-banner:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 14px 32px rgba(196, 78, 140, 0.55);
}

@keyframes flokit-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.flokit-banner h2 {
  margin: 0 0 5px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.new-badge {
  background: #fff;
  color: #C2410C;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.flokit-banner p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.95;
}

.flokit-banner .flokit-arrow {
  flex-shrink: 0;
  font-size: 1.7rem;
  font-weight: 700;
  animation: arrow-nudge 1.3s ease-in-out infinite;
}

@keyframes arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(7px); }
}

/* ---------- Wave logo ---------- */

.brand-wave {
  width: 54px;
  height: 54px;
  animation: wave-spin 14s linear infinite;
}

@keyframes wave-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes wave-bob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-7px) rotate(4deg); }
}

.footer-wave {
  width: 30px;
  height: 30px;
  display: block;
  margin: 0 auto 10px;
  animation: wave-bob 5s ease-in-out infinite;
}

.no-results-wave {
  width: 46px;
  height: 46px;
  display: block;
  margin: 0 auto 10px;
  animation: wave-bob 3.8s ease-in-out infinite;
}

/* ---------- Section head + mobile view toggle ---------- */

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

.view-toggle {
  display: none;
  gap: 6px;
}

.view-btn {
  font-family: inherit;
  width: 40px;
  height: 34px;
  border-radius: 10px;
  border: 1.5px solid var(--divider);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.view-btn.active {
  background: var(--rf-blue);
  border-color: var(--rf-blue);
  color: #fff;
}

@media (max-width: 700px) {
  .view-toggle {
    display: inline-flex;
  }

  /* Default mobile layout: compact 2-up grid */
  main .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  body:not(.view-single) .card-body {
    padding: 11px 12px 13px;
  }

  body:not(.view-single) .tut-card h3 {
    font-size: 0.85rem;
  }

  body:not(.view-single) .card-body p {
    display: none;
  }

  body:not(.view-single) .badge {
    font-size: 0.62rem;
    padding: 2px 8px;
    margin-bottom: 6px;
  }

  body:not(.view-single) .duration {
    font-size: 0.66rem;
    margin-left: 5px;
  }

  /* "One at a time" option: full-width cards */
  body.view-single main .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Tutorial cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.tut-card {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tut-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--divider);
}

.tut-card .card-body {
  padding: 16px 20px 20px;
}

.tut-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(26, 79, 237, 0.15);
}

.tut-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: var(--rf-blue);
}

.tut-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.tut-card .badge {
  display: inline-block;
  background: #EEF3FF;
  color: var(--rf-blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

/* ---------- FAQ accordion ---------- */

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-item summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--rf-blue);
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-body {
  padding: 0 20px 18px;
  color: var(--text-muted);
}

.faq-body ol,
.faq-body ul {
  padding-left: 22px;
}

/* ---------- Tutorial page ---------- */

.tutorial-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 20px 80px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  text-decoration: none;
  font-weight: 600;
}

.tutorial-page h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--rf-blue);
  margin: 0 0 10px;
}

.tutorial-intro {
  color: var(--text-muted);
  margin-bottom: 26px;
}

.video-wrap {
  position: relative;
  padding-top: 56.25%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  margin-bottom: 34px;
  background: #000;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.step {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.step-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.step-num {
  background: var(--rf-blue);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.step h3 {
  margin: 0;
  font-size: 1.05rem;
}

.step p {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.step img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--divider);
  margin-top: 14px;
  display: block;
}

.common-problems {
  background: #FFF7ED;
  border: 1px solid #FDBA74;
  border-radius: 14px;
  padding: 22px;
  margin-top: 30px;
}

.common-problems h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: #C2410C;
}

.common-problems ul {
  margin: 0;
  padding-left: 22px;
  color: var(--text-muted);
}

.common-problems li {
  margin-bottom: 8px;
}

/* ---------- Duration tag on cards ---------- */

.duration {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 8px;
}

/* ---------- "Written steps coming soon" note ---------- */

.coming-soon {
  background: #EEF3FF;
  border: 1px dashed var(--rf-blue);
  border-radius: 14px;
  padding: 20px 22px;
  color: var(--text-muted);
  margin-bottom: 30px;
}

.coming-soon strong {
  color: var(--rf-blue);
}

/* ---------- Help strip ---------- */

.help-strip {
  background: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  margin-top: 40px;
}

.help-strip h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: var(--rf-blue);
}

.help-strip p {
  margin: 0 auto 18px;
  max-width: 480px;
  color: var(--text-muted);
}

.help-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.fb-ico {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--rf-blue);
  color: #fff;
}

.btn-primary:hover {
  background: var(--rf-blue-hover);
}

.btn-outline {
  border: 2px solid var(--rf-blue);
  color: var(--rf-blue);
}

.btn-outline:hover {
  background: #EEF3FF;
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 30px 20px 40px;
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .tut-card {
    transition: none;
  }
  .flokit-banner,
  .new-badge,
  .flokit-arrow,
  .brand-wave,
  .footer-wave,
  .no-results-wave {
    animation: none;
  }
}
