/* Omnisalud — línea corporativa: azul #0066B2 + magenta #E5007D */
:root {
  --brand-primary: #0066b2;
  --brand-primary-dark: #004d8c;
  --brand-accent: #e5007d;
  --brand-accent-dark: #c4006a;
  --brand-secondary: #e5007d;
  --brand-secondary-dark: #c4006a;
  --brand-navy: #004d8c;
  --brand-primary-light: #3388c9;
  --brand-sky: #e8f4fc;
  --brand-sky-deep: #d6ebf8;
  --brand-accent-soft: #fce8f2;
  --text: #333333;
  --text-muted: #5c6b7a;
  --border: #d4e4f0;
  --surface: #ffffff;
  --warning: #e8a317;
  --success: #0066b2;
  --radius: 12px;
  --shadow: 0 2px 14px rgba(0, 102, 178, 0.1);
  --font-display: "Nunito", "Montserrat", "Segoe UI", sans-serif;
  --font-body: "Open Sans", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--brand-sky);
  min-height: 100vh;
}

h1,
h2,
h3,
.logo-text {
  font-family: var(--font-display);
  color: var(--brand-navy);
}

a {
  color: var(--brand-primary);
}

.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--brand-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--brand-sky-deep);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
}

@media (min-width: 900px) {
  .brand {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
}

.brand-logo {
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  display: block;
}

.brand-logo--hero {
  height: 56px;
  max-width: 240px;
  margin-bottom: 1rem;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
  padding-left: 0.15rem;
}

.nav-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-pills button {
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--brand-navy);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.nav-pills button:hover {
  border-color: var(--brand-primary);
  background: var(--brand-sky);
}

.nav-pills button.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.nav-pills button.active:hover {
  background: var(--brand-primary-dark);
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.view {
  display: none;
  animation: fadeIn 0.25s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  background: linear-gradient(120deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem 2rem 2.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 4px solid var(--brand-accent);
  box-shadow: var(--shadow);
}

.hero h1 {
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.hero p {
  margin: 0;
  opacity: 0.92;
  max-width: 52ch;
}

.hero-badge {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.25rem 0.75rem;
  background: #fff;
  color: var(--brand-primary);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover {
  border-color: var(--brand-accent);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--brand-accent);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 0.35rem;
}

label .req {
  color: #c0392b;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.92rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 0;
  border-color: var(--brand-primary);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-primary-dark);
}

.btn-secondary {
  background: var(--brand-accent);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--brand-accent-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--brand-primary);
  color: var(--brand-primary);
}

.btn-outline:hover {
  background: var(--brand-sky);
}

.btn-group {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.progress-track {
  margin: 1.5rem 0;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 0.5rem;
}

.progress-steps::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 8%;
  right: 8%;
  height: 3px;
  background: var(--border);
  z-index: 0;
}

.progress-step {
  position: relative;
  z-index: 1;
  text-align: center;
  flex: 1;
  font-size: 0.68rem;
  color: var(--text-muted);
  max-width: 90px;
}

.progress-step .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border);
  margin: 0 auto 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
}

.progress-step.done .dot {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #fff;
}

.progress-step.current .dot {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.progress-step.current {
  color: var(--brand-navy);
  font-weight: 600;
}

.sla-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.sla-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 4px;
}

.status-pill {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-gestion {
  background: #fff3cd;
  color: #856404;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--brand-primary);
}

.timeline li {
  position: relative;
  padding: 0 0 1.25rem 1.25rem;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -1.45rem;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand-accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--brand-primary);
}

.timeline time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.timeline strong {
  display: block;
  color: var(--brand-navy);
  margin: 0.15rem 0;
}

.timeline p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.meta-item {
  background: var(--brand-sky);
  padding: 0.75rem;
  border-radius: 6px;
}

.meta-item span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.meta-item strong {
  font-size: 0.95rem;
  color: var(--brand-navy);
}

.alert {
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--brand-primary);
  background: var(--brand-sky);
}

.alert-warning {
  border-left-color: var(--warning);
  background: #fff9e6;
}

.success-box {
  text-align: center;
  padding: 2rem 1rem;
}

.success-box .icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border: 3px solid var(--brand-accent);
}

.code-display {
  font-family: Consolas, monospace;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--brand-navy);
  background: var(--brand-sky);
  padding: 0.75rem 1rem;
  border-radius: 6px;
  display: inline-block;
  margin: 0.5rem 0;
}

.demo-banner {
  background: var(--brand-primary-dark);
  color: #fff;
  text-align: center;
  padding: 0.4rem;
  font-size: 0.78rem;
}

.demo-banner strong {
  color: #fff;
  background: var(--brand-accent);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}

.footer {
  text-align: center;
  padding: 1.5rem 1.25rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.92);
  border-top: 4px solid var(--brand-accent);
  background: linear-gradient(180deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
  margin-top: 2rem;
}

.footer-logo {
  height: 40px;
  width: auto;
  margin: 0 auto 0.75rem;
  display: block;
}

.footer p {
  margin: 0.35rem 0;
}

.checkbox-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.85rem;
}

.checkbox-row input {
  width: auto;
  margin-top: 0.25rem;
}

.admin-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
}

@media (max-width: 800px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}
