/* ============================================================
   KMT Laboratorio de Patología — Landing Page Styles
   ============================================================ */

/* --- CSS Variables ----------------------------------------- */
:root {
  --primary:       #5b2082;
  --primary-light: #7b35ad;
  --accent:        #e91e8c;
  --accent-dark:   #c4177a;
  --text-dark:     #2c1654;
  --text-muted:    #6b5f7a;
  --bg-light:      #faf5ff;
  --bg-white:      #ffffff;
  --border:        #e8d9f5;
  --shadow:        0 4px 24px rgba(91, 32, 130, 0.10);
  --radius:        10px;
  --transition:    0.25s ease;
  --nav-height:    76px;
}

/* --- Reset -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Utility ----------------------------------------------- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: 80px 0; }
.section-alt { background: var(--bg-light); }
.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}
.section-header { margin-bottom: 2.5rem; }
.divider {
  width: 56px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  margin: 0.6rem 0 1rem;
}
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: var(--bg-white);
  box-shadow: 0 2px 12px rgba(91,32,130,0.10);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.brand-molecule {
  width: 42px;
  height: 50px;
  flex-shrink: 0;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand-kmt {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
}
.brand-sub {
  font-size: 0.62rem;
  color: var(--text-dark);
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  margin-top: 2px;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.navbar-nav a {
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dark);
  transition: var(--transition);
  white-space: nowrap;
}
.navbar-nav a:hover { color: var(--primary); background: var(--bg-light); }
.navbar-nav .nav-admin {
  background: var(--primary);
  color: #fff !important;
  margin-left: 0.5rem;
  font-weight: 600;
}
.navbar-nav .nav-admin:hover { background: var(--primary-light); }
.navbar-nav button.nav-admin {
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: inherit;
}

/* Hamburger */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.navbar-toggle span {
  display: block;
  width: 26px; height: 2.5px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Mobile nav open state */
.navbar-nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--nav-height);
  left: 0; right: 0;
  background: var(--bg-white);
  padding: 1rem 1.25rem 1.5rem;
  box-shadow: 0 8px 24px rgba(91,32,130,0.12);
  gap: 0.1rem;
}
.navbar-nav.open a { padding: 0.65rem 1rem; font-size: 1rem; }
.navbar-nav.open .nav-admin { text-align: center; margin: 0.5rem 0 0; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  margin-top: var(--nav-height);
  min-height: 560px;
  background: linear-gradient(135deg, var(--text-dark) 0%, var(--primary) 60%, var(--accent) 100%);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 4rem 0;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content {
  position: relative;
  max-width: 680px;
}
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 50px;
  margin-bottom: 1.25rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 2rem;
  max-width: 520px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ============================================================
   ABOUT — Sobre Nosotros
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.02rem;
}
.about-image {
  background: var(--bg-light);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-muted);
}
.about-image .placeholder-icon { font-size: 3rem; opacity: 0.4; }
.about-image .placeholder-label { font-size: 0.9rem; }

/* ============================================================
   SERVICES — Servicios
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.service-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(13,79,139,0.15);
  border-color: var(--accent);
}
.service-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.75rem;
  color: #fff;
}
.service-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.6rem;
}
.service-card p { font-size: 0.92rem; color: var(--text-muted); }

/* ============================================================
   HISTORY — Historia / Visión / Misión / Valores
   ============================================================ */
.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.history-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}
.history-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.history-card p { color: var(--text-muted); font-size: 0.97rem; }

/* ============================================================
   SCHEDULE — Horario
   ============================================================ */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.schedule-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.schedule-card .schedule-days {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.schedule-card .schedule-hours {
  color: var(--accent-dark);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.3rem;
}
.schedule-card .schedule-note {
  font-size: 0.83rem;
  color: var(--text-muted);
}
.schedule-emergency {
  margin-top: 2rem;
  background: linear-gradient(135deg, var(--text-dark), var(--primary));
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.schedule-emergency .em-icon { font-size: 2rem; }
.schedule-emergency strong { font-size: 1.1rem; }
.schedule-emergency p { font-size: 0.92rem; opacity: 0.9; }

/* ============================================================
   RIGHTS — Derechos y Deberes
   ============================================================ */
.rights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.rights-col h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.rights-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.97rem;
  color: var(--text-muted);
}
.rights-list li:last-child { border-bottom: none; }
.rights-list .ri-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  margin-top: 2px;
}
.rights-col.derechos .ri-icon { background: #e8f5e9; color: #2e7d32; }
.rights-col.deberes .ri-icon  { background: #e3f2fd; color: var(--primary); }

/* ============================================================
   CONTACT — Contacto
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 3rem;
  align-items: start;
}
.contact-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
}
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.contact-item .ci-icon {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: var(--primary);
}
.contact-item .ci-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}
.contact-item .ci-value {
  font-size: 0.97rem;
  color: var(--text-dark);
  font-weight: 500;
}
.contact-form {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.contact-form h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 0.97rem;
  color: var(--text-dark);
  background: var(--bg-white);
  transition: var(--transition);
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(44,181,172,0.15);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.btn-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-submit:hover { background: var(--primary-light); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--text-dark);
  color: rgba(255,255,255,0.75);
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand .brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
}
.footer-brand p { font-size: 0.9rem; line-height: 1.7; }
.footer-col h4 {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 1rem;
}
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  transition: var(--transition);
}
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.footer-bottom a { color: var(--accent); }

/* ============================================================
   RESPONSIVE — Tablet (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .section { padding: 60px 0; }
  .section-title { font-size: 1.7rem; }
  .navbar-nav { display: none; }
  .navbar-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; gap: 2rem; }
  .about-image { min-height: 220px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .history-grid { grid-template-columns: 1fr; }
  .rights-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 560px)
   ============================================================ */
@media (max-width: 560px) {
  .hero { min-height: 480px; padding: 3rem 0; }
  .hero h1 { font-size: 1.9rem; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { text-align: center; }
  .services-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .schedule-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   ADMIN — Login Page
   ============================================================ */
.admin-body {
  margin: 0;
  padding: 0;
  background: none;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
.login-page {
  width: 100%;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* Logo inside card */
.login-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.login-molecule {
  width: 38px;
  height: 45px;
  flex-shrink: 0;
}
.login-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.login-kmt {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
}
.login-sub {
  font-size: 0.56rem;
  color: var(--text-dark);
  font-weight: 500;
  white-space: nowrap;
  margin-top: 2px;
}

/* Headings */
.login-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.3rem;
}
.login-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

/* Flash messages */
.login-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}
.login-notice {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

/* Form fields */
.login-field {
  margin-bottom: 1.1rem;
}
.login-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}
.login-field input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.97rem;
  color: var(--text-dark);
  background: var(--bg-white);
  transition: var(--transition);
  font-family: inherit;
  box-sizing: border-box;
}
.login-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91,32,130,0.12);
}

/* Submit button */
.login-card form input[type="submit"] {
  width: 100%;
  padding: 0.85rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
  font-family: inherit;
}
.login-card form input[type="submit"]:hover {
  background: var(--primary-light);
}

/* Footer link */
.login-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.88rem;
}
.login-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.login-footer a:hover { text-decoration: underline; }
