﻿:root {
  --bg: #eef5ed;
  --bg-soft: #f7faf5;
  --card: rgba(255, 255, 255, 0.94);
  --soft: #f3f8f2;
  --line: #d7e5d5;
  --line-strong: #bfd4bf;
  --txt: #1f382b;
  --muted: #657a6e;
  --pri: #2f6a45;
  --pri2: #1f4d31;
  --priSoft: #e4f0e5;
  --priGlow: rgba(47, 106, 69, 0.16);
  --leaf: #76b867;
  --leaf-soft: #edf7e7;
  --gold: #d8b35a;
  --red: #d42020;
  --orange: #f5821f;
  --yellow: #f5c518;
  --green-vivid: #39b54a;
  --blue: #3d6fc8;
  --violet: #9b59b6;
  --pink: #e91e8c;
  --teal: #1a8f7a;
  --warn: #9f6d20;
  --warnSoft: #fff7e7;
  --danger: #b84339;
  --dangerSoft: #fbeceb;
  --ok: #1f7a47;
  --okSoft: #e8f6ed;
  --shadow: 0 18px 46px rgba(27, 54, 37, 0.08);
  --shadow-strong: 0 28px 72px rgba(25, 49, 34, 0.14);
  --shadow-soft: 0 10px 24px rgba(30, 59, 41, 0.08);
  --font: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--txt);
  background:
    radial-gradient(circle at top left, rgba(118, 184, 103, 0.18), transparent 24rem),
    radial-gradient(circle at top right, rgba(216, 179, 90, 0.12), transparent 22rem),
    linear-gradient(180deg, #f8fcf7 0%, var(--bg) 26%, #f5f7f2 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-height: 3.35rem;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

textarea {
  min-height: 7.5rem;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--pri);
  box-shadow: 0 0 0 4px var(--priGlow), 0 16px 30px rgba(47, 106, 69, 0.08);
  transform: translateY(-1px);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffdfd;
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1rem 1.1rem 4rem;
}

.topShell {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: 0.55rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, rgba(248, 252, 247, 0.96), rgba(248, 252, 247, 0.88), rgba(248, 252, 247, 0));
  backdrop-filter: blur(14px);
}

.hero {
  padding: 0.9rem 1.05rem;
  border-radius: 26px;
  color: var(--txt);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(243, 249, 241, 0.92)),
    linear-gradient(120deg, rgba(118, 184, 103, 0.08), rgba(216, 179, 90, 0.08));
  border: 1px solid rgba(191, 212, 191, 0.75);
  box-shadow: var(--shadow-soft);
}

.heroTop {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.logo {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(118, 184, 103, 0.18), rgba(47, 106, 69, 0.1));
  font-weight: 800;
  color: var(--pri2);
  border: 1px solid rgba(47, 106, 69, 0.12);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  line-height: 1.08;
  color: var(--pri2);
}

.hero p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.heroMeta {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

.heroCard {
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(191, 212, 191, 0.68);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.progressHead {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--pri2);
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(47, 106, 69, 0.08), rgba(118, 184, 103, 0.14));
  overflow: hidden;
  margin-top: 0.6rem;
}

.fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7bc16c, #2f6a45 70%, #20492f);
}

.feedback {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.75rem;
}

.layout {
  display: grid;
  gap: 1rem;
}

.notice,
.errorSummary,
.successSummary {
  display: none;
  padding: 1rem;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.notice.show,
.errorSummary.show,
.successSummary.show {
  display: block;
}

.notice {
  background: var(--warnSoft);
  border: 1px solid rgba(159, 109, 32, 0.18);
  color: #845114;
}

.errorSummary {
  background: var(--dangerSoft);
  border: 1px solid rgba(184, 67, 57, 0.24);
  color: #7d281f;
}

.successSummary {
  background: var(--okSoft);
  border: 1px solid rgba(32, 112, 70, 0.24);
  color: var(--ok);
}

.errorSummary ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.wizard {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(215, 229, 213, 0.95);
  border-radius: 36px;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
  padding: 1rem;
  display: grid;
  gap: 1rem;
  backdrop-filter: blur(12px);
}

.tabs {
  display: flex;
  gap: 0.65rem;
  overflow: auto;
  padding: 0.15rem 0.15rem 0;
}

.tab {
  border: 1px solid rgba(191, 212, 191, 0.78);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.8rem 1.08rem;
  white-space: nowrap;
  flex: 0 0 auto;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: all 180ms ease;
}

.tab.active {
  background: linear-gradient(180deg, rgba(228, 240, 229, 1), rgba(241, 248, 240, 0.95));
  color: var(--pri2);
  border-color: rgba(47, 106, 69, 0.26);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(47, 106, 69, 0.1);
}

.step {
  display: none;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 1.65rem 1.35rem;
  background: var(--card);
  border: 1px solid rgba(215, 229, 213, 0.92);
  border-radius: 32px;
  box-shadow: var(--shadow);
  min-height: min(74vh, 860px);
  align-content: start;
}

.step.active {
  display: grid;
}

.messageStep {
  place-items: center;
  min-height: min(74vh, 860px);
  padding: 1rem;
}

.messageCard {
  width: min(100%, 820px);
  padding: 3rem 1.75rem;
  text-align: center;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(248, 251, 248, 0.98), rgba(255, 247, 238, 0.94));
  border: 1px solid rgba(47, 111, 79, 0.14);
  box-shadow: var(--shadow);
}

.messageCard.ok {
  background: linear-gradient(180deg, rgba(231, 246, 237, 0.98), rgba(247, 252, 248, 0.94));
  border-color: rgba(32, 112, 70, 0.18);
}

.welcomeStage {
  width: min(100%, 980px);
  min-height: min(72vh, 820px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.5rem;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 34px;
  background:
    radial-gradient(circle at top, rgba(118, 184, 103, 0.1), transparent 30rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 251, 245, 0.98));
  border: 1px solid rgba(215, 229, 213, 0.96);
  box-shadow: 0 30px 70px rgba(30, 59, 41, 0.12);
  animation: welcomeFade 700ms ease both;
}

.welcomeImage {
  display: block;
  width: min(100%, 840px);
  max-height: 62vh;
  object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(32, 73, 47, 0.12));
  animation: heroFloat 900ms ease both;
}

.welcomeBtn {
  min-width: min(18rem, 100%);
  justify-self: center;
}

.pill {
  display: inline-flex;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--priSoft);
  color: var(--pri2);
  font-weight: 700;
  font-size: 0.84rem;
}

.messageCard.ok .pill {
  background: var(--okSoft);
  color: var(--ok);
}

.messageCard h2 {
  margin: 1rem 0 0.9rem;
  font-size: clamp(2.2rem, 5vw, 3.35rem);
  line-height: 1.02;
}

.messageCard p {
  margin: 0 auto;
  max-width: 43rem;
  color: var(--muted);
  line-height: 1.8;
  font-size: clamp(1rem, 2.2vw, 1.14rem);
}

.messageSpacing,
.infoSpacing {
  margin-top: 1rem;
}

.title {
  margin: 0 0 0.35rem;
  font-size: 1.22rem;
}

.copy {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.65;
  max-width: 64rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label,
.field legend {
  font-weight: 700;
  font-size: 0.94rem;
}

.req {
  color: var(--danger);
}

.err {
  min-height: 1rem;
  font-size: 0.8rem;
  color: var(--danger);
}

.help {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}
/* P1.3: Small inline note for optional fields (e.g. "opcional — menores: usar RC") */
.fieldNote {
  font-style: normal;
  font-weight: normal;
  font-size: 0.78em;
  color: var(--muted);
  margin-left: 0.25rem;
}

.soft,
.info,
.residentLead {
  padding: 1rem 1.05rem;
  border-radius: 20px;
  color: var(--muted);
}

.soft {
  background: var(--soft);
  border: 1px dashed rgba(47, 106, 69, 0.2);
}

.info {
  background: linear-gradient(180deg, #fafcf8, #f4f8f1);
  border: 1px solid rgba(216, 179, 90, 0.18);
}

.residentLead {
  background: rgba(229, 240, 233, 0.85);
  border: 1px solid rgba(47, 111, 79, 0.18);
  margin-bottom: 1rem;
}

.soft strong,
.info strong,
.residentLead strong {
  color: var(--pri2);
}

.choices {
  display: grid;
  gap: 0.8rem;
}

.choice {
  position: relative;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(215, 229, 213, 0.95);
  background: rgba(255, 255, 255, 0.9);
  transition: all 180ms ease;
}

.choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice.on {
  border: 2px solid var(--pri);
  background: linear-gradient(135deg, rgba(57, 181, 74, 0.13) 0%, rgba(245, 252, 245, 0.98) 70%);
  box-shadow: 0 0 0 3px rgba(47, 106, 69, 0.12), 0 16px 32px rgba(47, 106, 69, 0.18);
}

.choice.on::after {
  content: "✓";
  position: absolute;
  top: 0.7rem;
  right: 0.85rem;
  width: 1.6rem;
  height: 1.6rem;
  background: var(--pri);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.choice strong {
  display: block;
  margin-bottom: 0.25rem;
}

.choice span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(47, 111, 79, 0.14);
  background: var(--soft);
}

.check input {
  width: 1.1rem;
  height: 1.1rem;
  min-height: auto;
  margin-top: 0.15rem;
}

.head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin: 1.2rem 0 0.8rem;
}

.head:first-child {
  margin-top: 0;
}

.head h3 {
  margin: 0;
  font-size: 1rem;
}

.badge {
  display: inline-flex;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--priSoft), #f2f8f0);
  color: var(--pri2);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(47, 106, 69, 0.12);
}

.repeater {
  display: grid;
  gap: 1rem;
}

.item {
  border: 1px solid rgba(47, 106, 69, 0.12);
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 246, 0.95));
  box-shadow: 0 12px 30px rgba(30, 59, 41, 0.05);
}

.itemHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border-bottom: 1px solid rgba(215, 229, 213, 0.9);
  background: linear-gradient(180deg, rgba(247, 251, 246, 0.96), rgba(242, 247, 240, 0.92));
}

.itemBody {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.row,
.footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.footer {
  justify-content: space-between;
  padding: 0.25rem 0.25rem 0;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(248, 252, 247, 0), rgba(248, 252, 247, 0.92) 35%, rgba(248, 252, 247, 0.98));
  backdrop-filter: blur(10px);
}

.btn {
  min-height: 3.1rem;
  border-radius: 18px;
  padding: 0.9rem 1.2rem;
  border: 0;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.pri {
  background: linear-gradient(180deg, #3f8755, #2a6540);
  color: #fff;
  box-shadow: 0 16px 30px rgba(47, 106, 69, 0.2);
}

.sec {
  background: rgba(255, 255, 255, 0.92);
  color: var(--pri2);
  border: 1px solid rgba(47, 106, 69, 0.16);
}

.neu {
  background: linear-gradient(180deg, #f7f7f2, #eef3ea);
  color: #516454;
  border: 1px solid rgba(47, 106, 69, 0.1);
}

.danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid rgba(184, 67, 57, 0.2);
}

.btn[disabled] {
  opacity: 0.58;
  cursor: not-allowed;
}

.btn:not([disabled]):hover {
  transform: translateY(-1px);
}

.pri:not([disabled]):hover {
  box-shadow: 0 20px 34px rgba(47, 106, 69, 0.24);
}

.sec:not([disabled]):hover,
.neu:not([disabled]):hover,
.danger:not([disabled]):hover {
  box-shadow: 0 12px 24px rgba(30, 59, 41, 0.08);
}

.hidden {
  display: none !important;
}

.json {
  background: linear-gradient(180deg, #1b2820, #203228);
  color: #dcefe1;
  border-radius: 20px;
  padding: 1rem;
  overflow: auto;
  border: 1px solid rgba(118, 184, 103, 0.14);
}

.json pre {
  margin: 0.75rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  line-height: 1.55;
}

@keyframes welcomeFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFloat {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 759px) {
  .page {
    padding: 0.75rem 0.8rem 4rem;
  }

  .topShell {
    padding-top: 0.4rem;
  }

  .hero {
    padding: 1rem;
    border-radius: 24px;
  }

  .heroTop {
    align-items: flex-start;
  }

  .wizard {
    padding: 0.8rem;
  }

  .step {
    padding: 1.15rem 1rem;
    min-height: 70vh;
  }

  .messageCard {
    padding: 2.3rem 1.2rem;
  }

  .welcomeStage {
    min-height: 66vh;
    padding: 0.8rem 0.4rem 1rem;
    gap: 1.15rem;
  }

  .welcomeImage {
    width: min(100%, 100%);
    max-height: none;
  }

  .footer {
    padding-top: 0.35rem;
  }

  .hero {
    padding: 0.55rem 0.75rem;
    border-radius: 18px;
  }
  .heroTop {
    gap: 0.55rem;
    align-items: center;
  }
  .logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 0.7rem;
    flex-shrink: 0;
  }
  .hero h1 {
    font-size: 0.92rem;
    line-height: 1.2;
  }
  .hero p {
    font-size: 0.75rem;
    margin-top: 0.15rem;
  }
  .heroMeta {
    margin-top: 0.5rem;
    gap: 0.4rem;
  }
  .heroCard {
    padding: 0.45rem 0.75rem;
    border-radius: 12px;
  }
  .progressHead {
    font-size: 0.78rem;
  }
  .bar {
    height: 6px;
    margin-top: 0.3rem;
  }
  .help {
    font-size: 0.72rem;
  }
  #fechaActual {
    font-size: 0.78rem;
  }
}

@media (min-width: 760px) {
  .heroMeta,
  .g2,
  .c2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .g3,
  .c3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .step {
    padding: 2rem;
    min-height: 76vh;
  }

  .wizard {
    padding: 1.1rem;
  }
}
