:root {
  --bg-deep: #06150f;
  --bg-mid: #0d2b20;
  --bg-accent: #153e2e;
  --brand: #8bb663;
  --brand-soft: #b8d597;
  --text-main: #eff6ee;
  --text-soft: rgba(239, 246, 238, 0.78);
  --border: rgba(193, 229, 198, 0.16);
  --glass: rgba(13, 34, 25, 0.62);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Montserrat", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 12%, rgba(146, 216, 142, 0.12), transparent 18%),
    radial-gradient(circle at 82% 10%, rgba(118, 190, 126, 0.14), transparent 20%),
    linear-gradient(135deg, var(--bg-deep), #092017 42%, var(--bg-mid) 74%, var(--bg-accent));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 36%),
    radial-gradient(circle at 50% 0%, rgba(180, 220, 166, 0.08), transparent 28%);
  mix-blend-mode: screen;
}

.diagnostico-shell {
  min-height: 100vh;
  padding: 24px;
}

.diagnostico-topbar,
.step-card,
.progress-card,
.formula-card,
.step-nav,
.form-status {
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    rgba(9, 24, 18, 0.76);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.diagnostico-topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px 22px;
  border-radius: var(--radius-xl);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  width: 110px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-copy h1,
.section-heading h2,
.advisor-card h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-copy p,
.section-heading p,
.field small,
.status-badge span {
  margin: 6px 0 0;
  color: var(--text-soft);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--brand-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.status-badge {
  min-width: 250px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(13, 37, 27, 0.74);
}

.status-badge strong {
  display: block;
  font-size: 1rem;
}

.diagnostico-main {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.diagnostico-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 18px;
}

.progress-card,
.formula-card,
.step-nav {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.progress-track {
  height: 10px;
  margin: 14px 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 12.5%;
  border-radius: inherit;
  background: linear-gradient(90deg, #89b262, #d8d492);
  transition: width 240ms ease;
}

.step-nav {
  display: grid;
  gap: 10px;
}

.step-nav button {
  border: 0;
  text-align: left;
  padding: 13px 15px;
  border-radius: 14px;
  font: inherit;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.step-nav button:hover,
.step-nav button.is-active {
  background: rgba(139, 182, 99, 0.18);
  transform: translateX(3px);
}

.diagnostico-form {
  display: grid;
  gap: 18px;
}

.step-card {
  display: none;
  padding: 28px;
  border-radius: var(--radius-xl);
}

.step-card.is-active {
  display: block;
}

.section-heading {
  margin-bottom: 24px;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field-span-2 {
  grid-column: span 2;
}

.field-span-3 {
  grid-column: span 3;
}

.field {
  display: grid;
  gap: 10px;
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(4, 14, 11, 0.66);
  color: var(--text-main);
  padding: 14px 15px;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(208, 219, 144, 0.52);
  box-shadow: 0 0 0 4px rgba(161, 198, 109, 0.12);
}

.metric-stack,
.advisor-list {
  display: grid;
  gap: 16px;
}

.metric-card,
.advisor-card,
.preview-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(7, 20, 15, 0.6);
}

.metric-card h3,
.preview-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.metric-card p,
.preview-card p {
  margin: 0;
  color: var(--text-soft);
}

.metric-meta {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.metric-meta small {
  color: rgba(216, 230, 210, 0.74);
}

.competency-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.advisor-summary,
.result-strip,
.preview-panel {
  margin-top: 18px;
}

.advisor-summary,
.result-strip {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(139, 182, 99, 0.08);
  border: 1px solid rgba(139, 182, 99, 0.18);
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-grid article {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.summary-grid strong {
  display: block;
  margin-top: 6px;
}

.file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.file-chip {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.section-actions,
.form-footer,
.footer-left,
.footer-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.form-footer {
  justify-content: space-between;
  padding: 0 4px 8px;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.primary-button,
.secondary-button,
.ghost-button {
  padding: 13px 18px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  color: #11231c;
  background: linear-gradient(135deg, #d7d38d, #8cb663);
  box-shadow: 0 14px 30px rgba(180, 196, 121, 0.24);
}

.secondary-button {
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(139, 182, 99, 0.24), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ghost-button {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.form-status {
  display: none;
  padding: 16px 18px;
  border-radius: 16px;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-success {
  border: 1px solid rgba(120, 207, 146, 0.3);
  background: rgba(67, 121, 83, 0.18);
}

.form-status.is-error {
  border: 1px solid rgba(220, 100, 100, 0.32);
  background: rgba(121, 42, 42, 0.22);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(4, 12, 9, 0.7);
  backdrop-filter: blur(12px);
}

.loading-overlay[hidden] {
  display: none;
}

.loading-card {
  width: min(90vw, 380px);
  padding: 28px;
  text-align: center;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(9, 24, 18, 0.92);
  box-shadow: var(--shadow);
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #d8d492;
  animation: spin 0.8s linear infinite;
}

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

@media (max-width: 1100px) {
  .diagnostico-main {
    grid-template-columns: 1fr;
  }

  .diagnostico-sidebar {
    position: static;
  }
}

@media (max-width: 820px) {
  .diagnostico-shell {
    padding: 16px;
  }

  .diagnostico-topbar,
  .brand-lockup,
  .form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .field-grid.cols-2,
  .field-grid.cols-3,
  .summary-grid,
  .competency-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2,
  .field-span-3 {
    grid-column: auto;
  }

  .footer-left,
  .footer-right {
    width: 100%;
    justify-content: stretch;
  }

  .footer-left button,
  .footer-right button {
    flex: 1 1 0;
  }
}
