/* ============================================================
   BMI Seguimiento — Estilos globales
   Paleta y tipografía replicadas de bmi.cl
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@600;700;800&family=Nunito+Sans:ital,opsz,wght@0,6..12,400;0,6..12,500;0,6..12,600;1,6..12,400&display=swap');

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --primary:        #0F5568;
  --primary-dark:   #0D1218;
  --primary-mid:    #0F6F86;
  --primary-light:  #11819B;
  --bg:             #F3F4F6;
  --bg-dark:        #111827;
  --bg-card:        #252A30;
  --white:          #FFFFFF;
  --text:           #4F5257;
  --text-dark:      #32323D;
  --muted:          #69727D;
  --text-light:     #EAE9F7;
  --success:        #20BD3C;
  --warning:        #E2D52D;
  --danger:         #E22D2D;
  --info:           #199BE6;
  --border:         #BEC5CA;
  --border-light:   #E0E0E0;
  --shadow:         0 2px 12px rgba(15,85,104,.12);
  --shadow-lg:      0 8px 32px rgba(15,85,104,.18);
  --radius:         10px;
  --radius-sm:      6px;
  --transition:     0.2s ease;
}

/* ── Reset base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,h2,h3,h4,h5,h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-dark);
  line-height: 1.25;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

img { max-width: 100%; height: auto; }

/* ── SVG global ─────────────────────────────────────────────── */
svg { display: block; flex-shrink: 0; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--primary-dark);
  padding: 0 2rem;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.navbar-brand img {
  height: 70px;
  width: auto;
}

.navbar-brand:hover { opacity: .85; }

.navbar-tagline {
  font-family: 'Nunito Sans', sans-serif;
  color: var(--text-light);
  font-size: .85rem;
  opacity: .7;
  letter-spacing: .03em;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: var(--primary);
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(17,129,155,.35) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; }

.hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: .75rem;
}

.hero p {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  opacity: .9;
}

/* ── Search box ─────────────────────────────────────────────── */
.search-box {
  display: flex;
  gap: .5rem;
  max-width: 500px;
  margin: 0 auto;
}

.search-box input {
  flex: 1;
  padding: .85rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 1rem;
  background: var(--white);
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(17,129,155,.25);
}

.search-box input::placeholder { color: var(--muted); }

.btn-search {
  padding: .85rem 1.75rem;
  background: var(--primary-dark);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn-search:hover  { background: var(--primary-mid); transform: translateY(-1px); }
.btn-search:active { transform: translateY(0); }
.btn-search:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Result card ────────────────────────────────────────────── */
.result-section {
  padding: 3rem 2rem;
  flex: 1;
}

.result-wrap { max-width: 600px; margin: 0 auto; }

.result-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  border-top: 4px solid var(--primary);
  animation: slideUp .25s ease;
}

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

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.result-card-header h3 {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.result-field {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}
.result-field:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.result-field label {
  display: block;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: .25rem;
}

.result-field .value {
  font-size: 1.05rem;
  color: var(--text-dark);
  font-weight: 500;
}

/* ── Badge estado ───────────────────────────────────────────── */
.badge-estado {
  display: inline-block;
  padding: .35em .9em;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Placeholder inicial ────────────────────────────────────── */
.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--muted);
}

.result-placeholder .placeholder-icon {
  opacity: .25;
  color: var(--primary);
}

.result-placeholder p {
  font-size: .95rem;
  line-height: 1.6;
  opacity: .6;
}

/* ── Estado vacío / error ───────────────────────────────────── */
.result-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  animation: slideUp .25s ease;
}

.result-empty .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .4;
}

.result-empty h3 {
  color: var(--text-dark);
  margin-bottom: .5rem;
}

.result-empty p { color: var(--muted); font-size: .95rem; }

/* ── Loading spinner ────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

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

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--bg-dark);
  margin-top: auto;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 3rem 2rem 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Brand */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo-wrap {
  height: 70px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.footer-logo {
  height: 70px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: left center;
  opacity: .9;
}

.footer-tagline {
  color: var(--text-light);
  font-size: .82rem;
  opacity: .5;
  letter-spacing: .04em;
}

/* Social */
.social-links {
  display: flex;
  gap: .6rem;
  margin-top: .25rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.6);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.social-links a:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: rgba(17,129,155,.12);
}

/* Contact */
.footer-contact h4 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary-light);
  margin-bottom: 1.1rem;
}

.footer-contact ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  color: rgba(234,233,247,.7);
  font-size: .875rem;
  line-height: 1.4;
}

.footer-contact li svg {
  flex-shrink: 0;
  margin-top: .15rem;
  color: var(--primary-light);
  opacity: .8;
}

.footer-contact a {
  color: rgba(234,233,247,.7);
  transition: color var(--transition);
}
.footer-contact a:hover { color: var(--primary-light); }

/* Copyright bar */
.footer-bottom {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  text-align: center;
}

.footer-bottom p {
  color: rgba(234,233,247,.35);
  font-size: .8rem;
}

.footer-bottom a {
  color: rgba(234,233,247,.45);
  transition: color var(--transition);
}
.footer-bottom a:hover { color: var(--primary-light); }

/* Responsive footer */
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; padding: 2.5rem 1.5rem 2rem; }
}

/* ── Botón primario general ─────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.btn-primary:hover { background: var(--primary-mid); color: var(--white); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-outline:hover { background: var(--primary); color: var(--white); }

/* ── Utilidades ─────────────────────────────────────────────── */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 540px) {
  .navbar { padding: 0 1rem; }
  .hero   { padding: 3.5rem 1rem 3rem; }
  .search-box { flex-direction: column; }
  .search-box input, .btn-search { width: 100%; }
  .result-card { padding: 1.5rem; }
  .result-card-header { flex-direction: column; align-items: flex-start; }
}
