html {
  background: #f8f9ff;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}

.template-hero {
  background:
    radial-gradient(circle at 42% 22%, rgba(0, 65, 167, 0.06), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.template-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(195, 198, 215, 0.78);
  box-shadow: 0 24px 70px rgba(0, 65, 167, 0.09);
}

.template-card-media {
  position: relative;
  isolation: isolate;
  overflow: visible !important;
}

.template-category-badge {
  position: absolute;
  left: 1.25rem;
  bottom: -1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 2.5rem);
  min-height: 2.1rem;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  color: #0041a7;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.55rem 0.9rem;
  backdrop-filter: blur(14px);
  transform: translateY(0);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.template-card:hover .template-category-badge {
  border-color: rgba(0, 65, 167, 0.28);
  box-shadow: 0 16px 34px rgba(0, 65, 167, 0.18);
  transform: translateY(-2px);
}

.template-card-content {
  padding-top: 2.25rem;
}

.template-search-shell {
  border-bottom: 1px solid rgba(203, 213, 225, 0.85);
  padding-bottom: 2rem;
}

.template-benefit {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  min-height: 1.5rem;
}

.template-benefit::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid #0054d7;
  color: #0054d7;
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1;
}

.template-preview-stage {
  position: relative;
  min-height: 430px;
}

.template-preview-glow {
  position: absolute;
  inset: 18% 6% 8%;
  border-radius: 3rem;
  background: linear-gradient(135deg, rgba(15, 55, 43, 0.18), rgba(0, 65, 167, 0.09));
  filter: blur(34px);
}

.template-preview-stack {
  position: relative;
  min-height: 430px;
}

.template-preview-card {
  position: absolute;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 1.05rem;
  background: #ffffff;
  box-shadow: 0 34px 84px rgba(15, 23, 42, 0.16);
}

.template-preview-main {
  top: 44px;
  right: 58px;
  width: 56%;
  height: 78%;
  z-index: 2;
  background: #0d3a2f;
}

.template-preview-float-one {
  top: 82px;
  right: 0;
  z-index: 3;
  width: 56%;
  height: 76%;
  background: rgba(224, 241, 238, 0.68);
  backdrop-filter: blur(3px);
}

.template-preview-float-two {
  top: 132px;
  right: 144px;
  z-index: 1;
  width: 38%;
  height: 38%;
  background: rgba(188, 217, 211, 0.7);
  backdrop-filter: blur(4px);
}

.template-preview-placeholder {
  height: 100%;
  padding: 2rem;
  background:
    linear-gradient(135deg, rgba(13, 58, 47, 0.94), rgba(13, 58, 47, 0.7)),
    #0d3a2f;
}

.template-preview-bar {
  height: 44%;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #0041a7, #1aa7ec);
}

.template-preview-title {
  margin-top: 1.4rem;
  width: 62%;
  height: 1rem;
  border-radius: 999px;
  background: #0f172a;
}

.template-preview-lines {
  margin-top: 1rem;
  width: 86%;
  height: 3.5rem;
  border-radius: 1.25rem;
  background: repeating-linear-gradient(#dbeafe 0 10px, transparent 10px 22px);
}

.template-preview-caption {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-radius: 1.4rem;
  background: rgba(255, 255, 255, 0.88);
  padding: 1rem;
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.template-preview-device {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58%;
  transform: translate(-50%, -42%) perspective(800px) rotateY(-12deg) rotateX(4deg);
  filter: drop-shadow(0 28px 32px rgba(15, 23, 42, 0.22));
}

.template-preview-screen {
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 0.45rem;
  background: #ffffff;
  aspect-ratio: 16 / 10;
}

.template-preview-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-preview-stand {
  width: 48%;
  height: 2.2rem;
  margin: -0.1rem auto 0;
  background: linear-gradient(180deg, #d9e3e0, #a8b8b3);
  clip-path: polygon(38% 0, 62% 0, 80% 100%, 20% 100%);
}

.template-preview-base {
  width: 78%;
  height: 1.25rem;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(90deg, rgba(165, 184, 178, 0.3), rgba(255, 255, 255, 0.88), rgba(165, 184, 178, 0.3));
}

.template-preview-caption span {
  color: #0041a7;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.template-preview-caption strong {
  color: #0f172a;
  font-size: 0.95rem;
}

.template-preview-badge {
  display: none;
}

.template-preview-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: #ff9800;
  box-shadow: 0 0 0 0.35rem rgba(255, 152, 0, 0.15);
}

.template-mode-tab,
.template-chip,
.template-tag {
  border: 1px solid rgba(210, 216, 232, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #424654;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.template-mode-tab {
  min-width: 9.2rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.88rem;
}

.template-chip {
  min-width: 4.9rem;
  padding: 0.34rem 0.78rem;
  font-size: 0.72rem;
}

.template-tag {
  padding: 0.4rem 0.7rem;
  color: #c56a00;
  background: #fff7ed;
  border-color: #fed7aa;
  font-size: 0.76rem;
}

.template-mode-tab:hover,
.template-chip:hover,
.template-tag:hover {
  transform: translateY(-1px);
  border-color: #0041a7;
  color: #0041a7;
}

.template-mode-tab.is-active {
  border-color: #0041a7;
  background: #0041a7;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(0, 65, 167, 0.18);
}

.template-searchbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  border-radius: 0.9rem;
  background: #f0f2ff;
  padding: 0.72rem 0.7rem 0.72rem 1.4rem;
}

.template-filter {
  width: 100%;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 1rem;
  background-color: #ffffff;
  padding: 0.9rem 1rem;
  color: #0f172a;
  font-size: 0.9rem;
  font-weight: 800;
}

.template-focus:focus {
  outline: 3px solid rgba(0, 65, 167, 0.22);
  outline-offset: 3px;
}

.template-spinner {
  animation: template-spin 0.8s linear infinite;
}

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

@media (max-width: 767px) {
  .template-preview-stage,
  .template-preview-stack {
    min-height: 320px;
  }

  .template-preview-main {
    top: 24px;
    right: 54px;
    width: 62%;
    height: 76%;
  }

  .template-preview-float-one {
    top: 58px;
    width: 58%;
    height: 72%;
  }

  .template-preview-float-two {
    top: 108px;
    right: 120px;
    width: 38%;
    height: 34%;
  }
}
