.forms-page .site-header {
  position: sticky;
  top: 10px;
  z-index: 20;
}

.forms-wrap {
  width: min(1160px, calc(100% - 48px));
  margin: 26px auto 86px;
}

.forms-hero {
  text-align: center;
  max-width: 840px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(16px);
}

.forms-hero.is-visible,
.forms-list-view.is-visible {
  animation: reveal 680ms cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}

.forms-hero h1 {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.forms-hero p {
  display: none;
}

.forms-list-view {
  margin-top: 54px;
  opacity: 0;
  transform: translateY(16px);
}

.forms-list-title {
  margin: 0 0 14px;
  font-family: "Exo 2", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  color: #8cb2d3;
  text-transform: uppercase;
}

.forms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.form-card {
  border: 1px solid rgba(88, 176, 245, 0.22);
  border-radius: 16px;
  background: rgba(7, 16, 27, 0.82);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  position: relative;
}

.form-sent-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(98, 198, 140, 0.44);
  background: rgba(34, 124, 72, 0.24);
  color: #9ce9c1;
  font-family: "Exo 2", sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.form-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  border: 1px solid rgba(88, 176, 245, 0.28);
  background: rgba(18, 43, 69, 0.45);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
}

.form-icon i {
  font-size: 1.1rem;
  color: #8bd8ff;
}

.form-card h3 {
  margin: 16px 0 0;
  font-family: "Exo 2", sans-serif;
  font-size: 1.55rem;
  line-height: 1.1;
}

.form-card p {
  margin: 10px 0 0;
  color: #8ca8c0;
  line-height: 1.45;
  font-size: 0.95rem;
}

.form-card--full {
  grid-column: 1 / -1;
  min-height: unset;
}

.form-card-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.form-card-body p {
  margin: 10px 0 0;
  color: #8ca8c0;
  line-height: 1.55;
  font-size: 0.95rem;
}

.form-card-body .dc-heading {
  display: block;
  color: #e2f0ff;
  font-family: "Exo 2", sans-serif;
  font-size: 1.1rem;
  margin-top: 6px;
}

.form-card-body p + p {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(88, 176, 245, 0.12);
}

.form-card-foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.form-state {
  color: #8fddb9;
  font-family: "Exo 2", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-state--closed {
  color: #f87171;
}

.form-open {
  border: 1px solid rgba(88, 176, 245, 0.36);
  background: rgba(21, 75, 118, 0.35);
  color: #d6ecff;
  border-radius: 999px;
  padding: 9px 12px;
  font-family: "Exo 2", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.form-open:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  border-color: rgba(110, 138, 165, 0.35);
  background: rgba(39, 53, 69, 0.34);
}

.form-open--postular {
  border-color: rgba(93, 183, 251, 0.5);
  background: linear-gradient(140deg, rgba(39, 143, 214, 0.96), rgba(22, 91, 153, 0.96));
  color: #f1faff;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 13px 28px;
  letter-spacing: 0.12em;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(16, 66, 111, 0.5);
}

.form-open--postular:hover {
  background: linear-gradient(140deg, rgba(55, 165, 240, 1), rgba(28, 105, 175, 1));
  border-color: rgba(93, 183, 251, 0.85);
  box-shadow: 0 12px 32px rgba(39, 143, 214, 0.55);
  color: #fff;
}

.form-card-postular {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(88, 176, 245, 0.2);
  display: flex;
  justify-content: center;
}

.form-card-postular .form-open--postular {
  width: 100%;
  max-width: 320px;
  text-align: center;
  display: block;
  padding: 16px 32px;
  font-size: 1rem;
}

.forms-detail-view {
  margin-top: 24px;
  display: none;
}

.forms-detail-view.is-open {
  display: block;
}

.forms-back {
  border: 0;
  background: transparent;
  color: #a8c2db;
  font-family: "Exo 2", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  padding: 0;
  cursor: pointer;
}

.forms-detail-head {
  margin-top: 16px;
}

.forms-detail-head h2 {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.04;
  text-transform: uppercase;
}

.forms-detail-head p {
  margin: 10px 0 0;
  color: #8ca8c1;
}

.form-shell {
  margin-top: 18px;
  border: 1px solid rgba(88, 176, 245, 0.25);
  border-radius: 14px;
  background: rgba(8, 17, 28, 0.84);
  padding: 16px;
}

.form-shell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.form-shell-head h3 {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-size: 1.1rem;
}

.form-status {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(98, 198, 140, 0.42);
  background: rgba(34, 124, 72, 0.24);
  color: #9ce9c1;
  font-family: "Exo 2", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.form-helper {
  margin: 10px 0 0;
  color: #89a5bf;
  font-size: 0.92rem;
}

.dynamic-form {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #c2def5;
  font-family: "Exo 2", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(92, 175, 241, 0.26);
  background: rgba(9, 20, 33, 0.88);
  color: #e5f1ff;
  font-family: "Space Grotesk", sans-serif;
  padding: 10px;
}

.field textarea {
  min-height: 114px;
  resize: vertical;
}

.form-submit {
  justify-self: end;
  margin-top: 4px;
  border: 1px solid rgba(88, 176, 245, 0.38);
  background: linear-gradient(140deg, rgba(39, 143, 214, 0.95), rgba(21, 87, 146, 0.95));
  color: #f0f8ff;
  border-radius: 9px;
  padding: 10px 14px;
  font-family: "Exo 2", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.form-submit:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  border-color: rgba(110, 138, 165, 0.35);
  background: rgba(39, 53, 69, 0.34);
}

.form-feedback {
  margin: 0;
  color: #8eb1cf;
  font-size: 0.84rem;
}

.forms-categories-view {
  margin-top: 42px;
}

.forms-cats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* Last 2 cards sit centered on a second row */
.forms-cats-grid .cat-card:nth-child(4),
.forms-cats-grid .cat-card:nth-child(5) {
  grid-column: auto;
}

.forms-cats-grid:has(.cat-card:nth-child(5)):not(:has(.cat-card:nth-child(6))) {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.forms-cats-grid:has(.cat-card:nth-child(5)):not(:has(.cat-card:nth-child(6))) .cat-card:nth-child(1) { grid-column: 1 / 3; }
.forms-cats-grid:has(.cat-card:nth-child(5)):not(:has(.cat-card:nth-child(6))) .cat-card:nth-child(2) { grid-column: 3 / 5; }
.forms-cats-grid:has(.cat-card:nth-child(5)):not(:has(.cat-card:nth-child(6))) .cat-card:nth-child(3) { grid-column: 5 / 7; }
.forms-cats-grid:has(.cat-card:nth-child(5)):not(:has(.cat-card:nth-child(6))) .cat-card:nth-child(4) { grid-column: 2 / 4; }
.forms-cats-grid:has(.cat-card:nth-child(5)):not(:has(.cat-card:nth-child(6))) .cat-card:nth-child(5) { grid-column: 4 / 6; }

@keyframes cat-hit {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0), 0 12px 36px rgba(0, 0, 0, 0.25);
    filter: brightness(1);
  }
  35% {
    box-shadow: 0 0 0 4px var(--cat-glow-strong), 0 0 38px var(--cat-glow-strong);
    filter: brightness(1.2);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0), 0 14px 42px rgba(0, 0, 0, 0.4);
    filter: brightness(1);
  }
}

@keyframes cat-icon-pop {
  0% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(0.9) rotate(-8deg); }
  80% { transform: scale(1.12) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.cat-card {
  --cat-border: rgba(88, 176, 245, 0.4);
  --cat-border-hover: rgba(88, 176, 245, 0.75);
  --cat-glow: rgba(119, 210, 255, 0.28);
  --cat-glow-strong: rgba(119, 210, 255, 0.42);
  border: 1px solid var(--cat-border);
  border-radius: 18px;
  background: rgba(7, 16, 27, 0.82);
  padding: 36px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  transition: border-color .2s, background .2s, transform .16s ease-out, box-shadow .2s;
}

/* Category palette */
.cat-card[data-cat-id="generales"] {
  --cat-border: rgba(165, 107, 255, 0.46);
  --cat-border-hover: rgba(188, 137, 255, 0.82);
  --cat-glow: rgba(188, 137, 255, 0.28);
  --cat-glow-strong: rgba(188, 137, 255, 0.46);
}

.cat-card[data-cat-id="comercios"] {
  --cat-border: rgba(98, 216, 177, 0.44);
  --cat-border-hover: rgba(120, 233, 196, 0.8);
  --cat-glow: rgba(120, 233, 196, 0.26);
  --cat-glow-strong: rgba(120, 233, 196, 0.44);
}

.cat-card[data-cat-id="lspd"] {
  --cat-border: rgba(77, 178, 255, 0.46);
  --cat-border-hover: rgba(106, 194, 255, 0.82);
  --cat-glow: rgba(106, 194, 255, 0.28);
  --cat-glow-strong: rgba(106, 194, 255, 0.46);
}

.cat-card[data-cat-id="sams"] {
  --cat-border: rgba(255, 106, 106, 0.46);
  --cat-border-hover: rgba(255, 132, 132, 0.82);
  --cat-glow: rgba(255, 132, 132, 0.28);
  --cat-glow-strong: rgba(255, 132, 132, 0.46);
}

.cat-card[data-cat-id="ilegales"] {
  --cat-border: rgba(255, 173, 66, 0.46);
  --cat-border-hover: rgba(255, 192, 105, 0.82);
  --cat-glow: rgba(255, 192, 105, 0.28);
  --cat-glow-strong: rgba(255, 192, 105, 0.46);
}

/* Subtle per-card gradient glow based on selected color */
.cat-card::before {
  background: radial-gradient(ellipse at 50% 0%, var(--cat-glow) 0%, transparent 70%);
}

.cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 50%),
    var(--cat-glow),
    rgba(0, 0, 0, 0) 52%
  );
  opacity: 0;
  transition: opacity .2s;
}

.cat-card:hover:not(.cat-card--empty) {
  border-color: var(--cat-border-hover);
  background: rgba(12, 28, 50, 0.95);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-6px) scale(1.02);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.48), 0 0 22px var(--cat-glow);
}

.cat-card:hover:not(.cat-card--empty)::after {
  opacity: 1;
}

.cat-card--impact {
  animation: cat-hit 420ms cubic-bezier(0.18, 0.82, 0.28, 1) forwards;
}

.cat-card--impact .cat-icon {
  animation: cat-icon-pop 420ms cubic-bezier(0.18, 0.82, 0.28, 1);
}

.cat-card--empty {
  opacity: 0.38;
  cursor: default;
}

.cat-card--closed {
  border-color: rgba(117, 129, 143, 0.36);
  background: rgba(18, 22, 28, 0.82);
  filter: grayscale(0.65);
  opacity: 0.72;
  cursor: not-allowed;
}

.cat-card--closed::after,
.cat-card--closed::before {
  opacity: 0 !important;
}

.cat-card--closed .cat-icon {
  border-color: rgba(117, 129, 143, 0.4);
  background: rgba(34, 39, 46, 0.6);
}

.cat-card--closed .cat-icon i,
.cat-card--closed .cat-count {
  color: #9ba9b7;
}

.cat-icon {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  border: 1px solid var(--cat-border);
  background: rgba(18, 43, 69, 0.55);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  position: relative;
  z-index: 1;
}

.cat-icon i {
  color: var(--cat-border-hover);
}

.cat-card h3 {
  margin: 0;
  font-family: "Exo 2", sans-serif;
  font-size: 1.15rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.cat-count {
  font-size: 0.78rem;
  color: #7a9db8;
  letter-spacing: .03em;
  position: relative;
  z-index: 1;
}

.forms-cats-grid--centered {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.forms-cats-grid--centered .cat-card {
  width: 220px;
  min-height: 180px;
}

@media (max-width: 860px) {
  .forms-cats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .forms-cats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .forms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .forms-wrap {
    width: min(1160px, calc(100% - 24px));
    margin-top: 18px;
  }

  .forms-page .site-header {
    position: static;
  }

  .forms-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    min-height: 0;
  }

  .form-shell {
    padding: 12px;
  }
}
