:root {
  --color-background: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-border: #E5E7EB;
  --color-primary: #1E3A5F;
  --color-primary-dark: #152A46;
  --color-action: #2563EB;
  --color-action-hover: #1D4ED8;
  --color-action-active: #1E40AF;
  --color-text-primary: #1F2937;
  --color-text-secondary: #4B5563;
  --color-text-label: #6B7280;
  --color-success: #059669;
  --color-success-bg: #ECFDF5;
  --color-success-text: #065F46;
  --color-success-border: #A7F3D0;
  --color-warning: #D97706;
  --color-warning-bg: #FFFBEB;
  --color-warning-text: #92400E;
  --color-warning-border: #FDE68A;
  --color-danger: #DC2626;
  --color-danger-bg: #FEF2F2;
  --color-danger-text: #991B1B;
  --color-danger-border: #FECACA;
  --radius: 0.5rem;
  --shadow-level1: 0 1px 3px 0 rgba(0,0,0,0.05), 0 1px 2px -1px rgba(0,0,0,0.05);
  --shadow-focus: 0 0 0 3px rgba(37,99,235,0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  background: var(--color-primary);
  color: #fff;
}
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: #fff;
}
.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.1);
  font-weight: 700;
  font-size: 13px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.brand-text small {
  color: rgba(255,255,255,0.7);
  font-size: 12px;
}
.main-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 14px;
  font-weight: 500;
}
.main-nav a {
  text-decoration: none;
  color: rgba(255,255,255,0.85);
}
.main-nav a:hover {
  color: #fff;
}

/* Flash messages */
.flash-stack {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid transparent;
}
.flash-error {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border-color: var(--color-danger-border);
}
.flash-info {
  background: #EFF6FF;
  color: #1E3A8A;
  border-color: #BFDBFE;
}

/* Layout sections */
.section-top {
  padding-top: 2rem;
}
.section {
  padding-top: 3.5rem;
}
.section-last {
  padding-bottom: 4rem;
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 0.25rem;
}
.section-title-sm {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 1rem;
}
.section-subtitle {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin: 0 0 1.5rem;
}

/* Home hero */
.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-label);
  font-size: 14px;
  margin-bottom: 1rem;
}
.dot {
  height: 8px;
  width: 8px;
  border-radius: 999px;
}
.dot-success {
  background: var(--color-success);
}
.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}
.hero-card {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-level1);
}
.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.7);
  margin: 0 0 0.5rem;
}
.hero-card h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}
.hero-lead {
  color: rgba(255,255,255,0.8);
  max-width: 42rem;
  margin: 0 0 1.5rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 14px;
}
.hero-meta-label {
  color: rgba(255,255,255,0.6);
  margin: 0;
}
.hero-meta-value {
  font-weight: 600;
  margin: 0.15rem 0 0;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-level1);
  padding: 1.5rem;
}
.side-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.edital-card {
  padding: 2rem;
}
.edital-card .card-text {
  margin-bottom: 1.5rem;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.card-title-sm {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.card-text {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin: 0;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}
.stat-label {
  font-size: 12px;
  color: var(--color-text-label);
  margin: 0.15rem 0 0;
}

.cta-grid,
.orient-grid,
.two-col,
.three-col {
  display: grid;
  gap: 1.5rem;
}
.cta-grid {
  grid-template-columns: 1fr 1fr;
}
.orient-grid,
.three-col {
  grid-template-columns: repeat(3, 1fr);
}
.two-col {
  grid-template-columns: 1fr 1fr;
}
.cta-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}
.requirements-intro {
  margin-bottom: 1rem;
}
.requirements-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  width: 36px;
  border-radius: 999px;
  background: var(--color-action);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0 1rem;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
.btn-block {
  width: 100%;
}
.btn-nowrap {
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-action);
  color: #fff;
}
.btn-primary:hover {
  background: var(--color-action-hover);
}
.btn-primary:active {
  background: var(--color-action-active);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-institutional {
  background: var(--color-primary);
  color: #fff;
}
.btn-institutional:hover {
  background: var(--color-primary-dark);
}
.btn-outline {
  background: #fff;
  border: 1px solid #D1D5DB;
  color: #374151;
}
.btn-outline:hover {
  background: #F3F4F6;
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}
.btn-ghost:hover {
  background: #F3F4F6;
}

/* Exigencias page */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.page-lead {
  color: var(--color-text-secondary);
  font-size: 14px;
  max-width: 42rem;
  margin: 0;
}

.alert {
  display: flex;
  gap: 0.75rem;
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 2rem;
  border: 1px solid;
}
.alert-info {
  background: rgba(37,99,235,0.05);
  border-color: rgba(37,99,235,0.3);
}
.alert-title {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 0.25rem;
}
.alert-text {
  color: var(--color-text-secondary);
  font-size: 14px;
  margin: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  padding-bottom: 3rem;
}
.content-main > section {
  margin-bottom: 2rem;
}
.content-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.card-row-icon {
  justify-content: flex-start;
  gap: 0.5rem;
}
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 20px;
  font-weight: 700;
  font-size: 14px;
}
.icon-success {
  color: var(--color-success);
}
.icon-danger {
  color: var(--color-danger);
}
.bullet-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.bullet-list li {
  padding-left: 1.1rem;
  position: relative;
}
.bullet-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
}
.bullet-success li::before {
  color: var(--color-success);
}
.bullet-danger li::before {
  color: var(--color-danger);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 0.65rem;
  border-radius: 0.375rem;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}
.badge-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  border-color: var(--color-danger-border);
}
.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border-color: var(--color-warning-border);
}
.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
  border-color: var(--color-success-border);
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 14px;
}
.timeline-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--color-text-secondary);
}
.timeline-list li strong {
  color: var(--color-text-primary);
  text-align: right;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
  padding: 0.5rem 0;
}
.faq-item:last-child {
  border-bottom: none;
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 0.25rem 0;
}
.faq-icon {
  color: var(--color-text-label);
}
.faq-answer {
  display: none;
  color: var(--color-text-secondary);
  font-size: 14px;
  margin: 0.5rem 0 0;
}
.faq-item.open .faq-answer {
  display: block;
}
.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

/* Consent form */
.consent-card {
  margin-bottom: 2.5rem;
}
.consent-eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-danger);
  margin: 0 0 0.25rem;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-secondary);
}
.checkbox-row:last-of-type {
  border-bottom: none;
}
.checkbox-row input {
  margin-top: 0.2rem;
  height: 18px;
  width: 18px;
  accent-color: var(--color-action);
  flex-shrink: 0;
}
.checkbox-row strong {
  color: var(--color-text-primary);
}
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.5rem;
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}
.stepper-item {
  display: flex;
  align-items: center;
  flex: 1;
}
.stepper-item:last-child {
  flex: none;
}
.stepper-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.stepper-item.is-completed .stepper-circle {
  background: var(--color-success);
  color: #fff;
}
.stepper-item.is-active .stepper-circle {
  background: var(--color-action);
  color: #fff;
}
.stepper-item.is-upcoming .stepper-circle {
  background: #fff;
  border: 2px solid #D1D5DB;
  color: var(--color-text-label);
}
.stepper-label {
  margin-left: 0.5rem;
  font-size: 14px;
  white-space: nowrap;
}
.stepper-item.is-active .stepper-label {
  font-weight: 600;
  color: var(--color-primary);
}
.stepper-item.is-completed .stepper-label {
  color: var(--color-text-secondary);
}
.stepper-item.is-upcoming .stepper-label {
  color: var(--color-text-label);
}
.stepper-line {
  margin: 0 0.75rem;
  height: 2px;
  flex: 1;
  background: var(--color-border);
}

/* Consulta page */
.form-narrow {
  max-width: 32rem;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}
.field input {
  height: 42px;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  border: 1px solid #D1D5DB;
  font-size: 15px;
  font-family: inherit;
}
.field input,
.field select,
.field textarea {
  height: 42px;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  border: 1px solid #D1D5DB;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--color-text-primary);
}
.field textarea {
  height: auto;
  min-height: 96px;
  padding: 0.6rem 0.75rem;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-action);
  box-shadow: var(--shadow-focus);
}
.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--color-danger);
  box-shadow: var(--shadow-focus-error);
}
.field-error {
  font-size: 13px;
  color: var(--color-danger);
  margin: 0;
}
.field-hint {
  font-size: 12px;
  color: var(--color-text-label);
  margin: 0;
}
.field-hint-right {
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1.5rem;
}
.form-grid .span-2 {
  grid-column: 1 / -1;
}
.form-section {
  margin-bottom: 2rem;
}
.form-section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border);
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 14px;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 0.4rem 0;
}
.toggle-row input {
  margin-top: 0.2rem;
  height: 18px;
  width: 18px;
  accent-color: var(--color-action);
  flex-shrink: 0;
}
.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}
.conditional-block {
  border-left: 3px solid var(--color-action);
  background: #F8FAFC;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem;
  margin: 0.75rem 0 1.5rem;
}
.conditional-block[hidden] {
  display: none;
}

.upload-zone {
  border: 2px dashed #93C5FD;
  background: #F8FAFC;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.upload-zone input[type="file"] {
  display: block;
  margin: 0.75rem auto 0;
  font-size: 14px;
}
.upload-spec {
  font-size: 13px;
  color: var(--color-text-label);
  margin: 0.35rem 0 0;
}
.upload-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-text);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  font-size: 13px;
  margin-bottom: 0.75rem;
}
.doc-card {
  margin-bottom: 1.5rem;
}
.doc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.5rem;
  font-size: 14px;
}
.summary-grid dt {
  color: var(--color-text-label);
  margin: 0;
}
.summary-grid dd {
  color: var(--color-text-primary);
  font-weight: 500;
  margin: 0.15rem 0 0;
}
.summary-full {
  grid-column: 1 / -1;
}
.summary-section {
  margin-bottom: 2rem;
}
.summary-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.result-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.result-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.6rem;
}
.result-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.result-label {
  color: var(--color-text-label);
}
.result-value {
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: right;
}

.protocolo-box {
  text-align: center;
  padding: 2rem;
}
.protocolo-value {
  font-family: "Inter", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  margin: 0.5rem 0 1.5rem;
}

.link-back {
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.link-back:hover {
  color: var(--color-text-primary);
}

.empty-state {
  text-align: left;
  max-width: 36rem;
}
.empty-state .card-text {
  margin-bottom: 1.25rem;
}

/* Footer */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.8);
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2.5rem 1.5rem;
  font-size: 14px;
}
.footer-title {
  color: #fff;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.footer-muted {
  color: rgba(255,255,255,0.6);
  margin-top: 0.5rem;
}
.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.footer-grid ul a {
  text-decoration: none;
}
.footer-grid ul a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1rem;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

@media (max-width: 900px) {
  .hero-grid,
  .cta-grid,
  .orient-grid,
  .two-col,
  .three-col,
  .steps-grid,
  .content-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .main-nav {
    display: none;
  }
  .stepper-label {
    display: none;
  }
}
