:root {
  color-scheme: dark;
  --bg: #0b0f1a;
  --bg-soft: #111729;
  --text: #e9eefb;
  --muted: #a1b0d3;
  --primary: #6f8cff;
  --accent: #64f4c7;
  --glow: rgba(111, 140, 255, 0.35);
  --card: rgba(17, 23, 41, 0.75);
  --border: rgba(130, 150, 200, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #162046, var(--bg));
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(111, 140, 255, 0.8), transparent 65%);
  filter: blur(10px);
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}

body::before {
  top: -120px;
  left: -80px;
}

body::after {
  bottom: -140px;
  right: -100px;
  animation-delay: -6s;
  background: radial-gradient(circle, rgba(100, 244, 199, 0.7), transparent 70%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero {
  text-align: center;
  animation: fadeUp 1s ease-out both;
}

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(111, 140, 255, 0.15);
  color: var(--primary);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__title {
  margin: 16px 0 8px;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.hero__subtitle {
  margin: 0 auto;
  max-width: 560px;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

.generator {
  display: grid;
  gap: 24px;
}

.generator__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.generator__title {
  margin: 0;
  font-size: 1.6rem;
}

.generator__tabs {
  display: inline-flex;
  padding: 6px;
  border-radius: 999px;
  background: rgba(17, 23, 41, 0.7);
  border: 1px solid var(--border);
}

.tab {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.tab.is-active {
  background: rgba(111, 140, 255, 0.2);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(111, 140, 255, 0.25);
}

.generator__content {
  position: relative;
  padding: 26px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(8, 12, 26, 0.6);
}

.policy-form {
  display: grid;
  gap: 24px;
  animation: fadeUp 0.6s ease-out both;
}

.common-fields {
  display: grid;
  gap: 18px;
}

.policy-panel {
  display: none;
  gap: 24px;
  animation: fadeUp 0.6s ease-out both;
}

.policy-panel.is-active {
  display: grid;
}

.stepper {
  display: flex;
  align-items: center;
}

.stepper__track {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--steps, 5), 1fr);
  gap: 8px;
}

.stepper__step {
  text-align: center;
  padding: 8px 6px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--muted);
  background: rgba(17, 23, 41, 0.7);
  border: 1px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.stepper__step:hover {
  border-color: rgba(111, 140, 255, 0.45);
  color: var(--text);
}

.stepper__step.is-active {
  color: var(--text);
  border-color: rgba(111, 140, 255, 0.5);
  background: rgba(111, 140, 255, 0.18);
}

.stepper__step.is-complete {
  color: var(--accent);
  border-color: rgba(100, 244, 199, 0.4);
  background: rgba(100, 244, 199, 0.1);
}

.form-step {
  display: none;
  gap: 18px;
}

.form-step.is-active {
  display: grid;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.checkbox-grid label {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(7, 10, 20, 0.35);
  transition: border 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.checkbox-grid label:hover {
  border-color: rgba(111, 140, 255, 0.35);
  background: rgba(17, 23, 41, 0.6);
  transform: translateY(-1px);
}

.checkbox-grid input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(130, 150, 200, 0.5);
  background: rgba(7, 10, 20, 0.6);
  display: grid;
  place-items: center;
  margin: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0px;
}

.checkbox-grid input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  transform: scale(0);
  transition: transform 0.2s ease;
  box-shadow: 0 0 10px rgba(111, 140, 255, 0.5);
}

.checkbox-grid input[type="checkbox"]:checked {
  border-color: rgba(111, 140, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(111, 140, 255, 0.15);
}

.checkbox-grid input[type="checkbox"]:checked::after {
  transform: scale(1);
}

.checkbox-grid input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(111, 140, 255, 0.3);
}

input,
select,
textarea {
  background: rgba(7, 10, 20, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(111, 140, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(111, 140, 255, 0.2);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.magic-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(130, 150, 200, 0.35);
  background: rgba(7, 10, 20, 0.6);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.magic-btn:hover {
  border-color: rgba(111, 140, 255, 0.5);
  color: var(--text);
  transform: translateY(-1px);
}

.field-tools {
  display: flex;
  justify-content: flex-end;
}

.modal {
  border: none;
  padding: 0;
  background: transparent;
  width: 100%;
  max-width: none;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal[open] {
  display: flex;
}

.modal::backdrop {
  background: rgba(5, 8, 16, 0.7);
  backdrop-filter: blur(6px);
}

.modal__card {
  position: relative;
  width: min(860px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: rgba(12, 16, 30, 0.95);
  border: 1px solid rgba(130, 150, 200, 0.3);
  border-radius: 20px;
  padding: 24px;
  display: grid;
  gap: 16px;
  box-shadow: 0 30px 60px rgba(5, 8, 16, 0.7);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.usecase-list {
  display: grid;
  gap: 12px;
}

.usecase-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(130, 150, 200, 0.25);
  background: rgba(7, 10, 20, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.usecase-item:hover {
  border-color: rgba(111, 140, 255, 0.5);
  transform: translateY(-1px);
}

.usecase-item input {
  display: none;
}

.usecase-item.is-active {
  border-color: rgba(111, 140, 255, 0.7);
  background: rgba(111, 140, 255, 0.12);
}

.template-list {
  display: grid;
  gap: 12px;
}

.template-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(130, 150, 200, 0.25);
  background: rgba(7, 10, 20, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  line-height: 1.5;
}

.template-item:hover {
  border-color: rgba(111, 140, 255, 0.5);
  background: rgba(17, 23, 41, 0.8);
}

.muted {
  color: var(--muted);
  margin: 0;
}

.muted.small {
  font-size: 0.85rem;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.form-actions__right {
  display: inline-flex;
  gap: 12px;
}

.ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.ghost:hover {
  border-color: rgba(111, 140, 255, 0.5);
  color: var(--primary);
}

.ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.output {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px rgba(8, 12, 26, 0.5);
}

.output__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.output__actions {
  display: inline-flex;
  gap: 10px;
}

.output textarea {
  min-height: 260px;
}

.seo,
.faq {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  background: rgba(12, 16, 30, 0.6);
  border: 1px solid rgba(130, 150, 200, 0.2);
}

.faq details {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(130, 150, 200, 0.2);
  background: rgba(7, 10, 20, 0.45);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.faq p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.card {
  position: relative;
  padding: 26px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 40px rgba(8, 12, 26, 0.6);
  display: grid;
  gap: 16px;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border 0.4s ease;
  animation: fadeUp 1.1s ease-out both;
}

.card:nth-child(2) {
  animation-delay: 0.15s;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(111, 140, 255, 0.3), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-8px);
  border-color: rgba(111, 140, 255, 0.6);
  box-shadow: 0 22px 45px rgba(7, 15, 40, 0.7);
}

.card:hover::after {
  opacity: 1;
}

.card--primary {
  border-color: rgba(111, 140, 255, 0.45);
  box-shadow: 0 22px 45px rgba(23, 35, 80, 0.7);
}

.card__top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card__icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 6px 12px rgba(100, 244, 199, 0.35));
}

.card__title {
  margin: 0;
  font-size: 1.4rem;
}

.card__desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.card__cta {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 600;
  color: #0b0f1a;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 12px 30px rgba(111, 140, 255, 0.35);
}

.card__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(111, 140, 255, 0.45);
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  animation: fadeUp 1.2s ease-out both;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(30px) translateX(20px);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .page {
    padding-top: 48px;
  }

  .hero__subtitle {
    font-size: 1rem;
  }

  .generator__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stepper__track {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions__right {
    width: 100%;
    flex-direction: column;
  }

  .output__header {
    flex-direction: column;
    align-items: flex-start;
  }
}
