/* ============================================================
   ScienceuP — Global Styles
   Tipografía, variables, layout base, header, footer,
   botones y componentes reutilizables en todas las páginas.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* --- Variables -------------------------------------------- */
:root {
  /* Colores principales */
  --color-primary:       #002f6c;
  --color-primary-dark:  #001e46;
  --color-primary-light: #e6edf7;
  --color-secondary:     #f27900;
  --color-secondary-dark:#c96400;
  --color-accent:        #7a9abf;
  --color-accent-light:  #d6e4f0;
  --color-dark:          #0a1628;
  --color-text:          #1a2a40;
  --color-muted:         #5a7a9a;
  --color-border:        #cdd9e8;
  --color-bg:            #f5f8fc;
  --color-white:         #FFFFFF;
  --color-danger:        #EF4444;
  --color-success:       #10B981;

  /* Tipografía */
  --font-heading: 'Poppins', sans-serif;
  --font-body:    'Inter', sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Espaciado */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --container-max: 1200px;
  --header-h:      72px;

  /* Bordes */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-2xl:  1.5rem;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transiciones */
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* --- Contenedor ------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* --- Tipografía ------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-dark);
}
h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

.text-muted   { color: var(--color-muted); }
.text-center  { text-align: center; }
.text-primary { color: var(--color-primary); }

/* --- Botones --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-base);
  transition: all var(--transition);
  white-space: nowrap;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-white);
  border-color: var(--color-secondary);
}
.btn-secondary:hover {
  background: var(--color-secondary-dark);
  border-color: var(--color-secondary-dark);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-outline-white {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255,255,255,0.6);
}
.btn-outline-white:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--color-white);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: var(--text-lg);
}
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

/* --- Secciones ------------------------------------------- */
.section    { padding-block: var(--space-20); }
.section-sm { padding-block: var(--space-12); }

.section-title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-4);
}
.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-muted);
  margin-bottom: var(--space-12);
  max-width: 640px;
  line-height: 1.7;
}

.section-header { margin-bottom: var(--space-12); }
.section-header.centered { text-align: center; }
.section-header.centered .section-subtitle { margin-inline: auto; }

/* Divisor decorativo */
.divider {
  width: 60px;
  height: 4px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  margin-block: var(--space-4);
}
.divider.centered { margin-inline: auto; }

/* Badge / etiqueta */
.badge {
  display: inline-block;
  padding: 0.25rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-primary { background: var(--color-primary-light); color: var(--color-primary); }
.badge-success { background: #fff3e0; color: #c96400; }
.badge-white   { background: rgba(255,255,255,0.15); color: var(--color-white); backdrop-filter: blur(4px); }

/* --- Tarjetas -------------------------------------------- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* --- Formularios ----------------------------------------- */
.form-group { margin-bottom: var(--space-5); }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(27 79 216 / 0.12);
}
.form-control.is-error { border-color: var(--color-danger); }
.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

/* --- Alertas --------------------------------------------- */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  display: none;
}
.alert.show     { display: block; }
.alert-danger   { background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5; }
.alert-success  { background: #F0FDF4; color: #166534; border: 1px solid #86EFAC; }
.alert-info     { background: var(--color-primary-light); color: var(--color-primary); border: 1px solid #C7D2FE; }

/* --- Modal genérico ------------------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease;
  position: relative;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-muted);
  font-size: var(--text-lg);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* === HEADER ============================================== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--color-primary);
  flex-shrink: 0;
}
.header-logo span { color: var(--color-secondary); color: #f27900; }

/* Nav principal */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.header-nav > a {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  transition: color var(--transition), background var(--transition);
}
.header-nav > a:hover,
.header-nav > a.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}
.nav-dropdown:hover .dropdown-toggle,
.nav-dropdown .dropdown-toggle.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-dropdown .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
}
.nav-dropdown:hover .dropdown-menu { display: block; }

.nav-dropdown .dropdown-menu a {
  display: block;
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
  color: var(--color-muted);
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
}
.nav-dropdown .dropdown-menu a:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Auth área */
.header-auth {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Botones del header en celeste */
.header-auth .btn-outline {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: transparent;
}
.header-auth .btn-outline:hover {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.header-auth .btn-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}
.header-auth .btn-primary:hover {
  background: #5f80a8;
  border-color: #5f80a8;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

/* Hamburger (móvil) */
.header-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  border-radius: var(--radius-md);
}
.header-menu-toggle span {
  width: 24px; height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.3s;
  display: block;
}

/* Menú móvil abierto */
#site-header.menu-open .header-nav {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--color-white);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  align-items: flex-start;
  gap: var(--space-1);
}
#site-header.menu-open .header-auth {
  display: flex;
}

/* Logo imagen en header */
.header-logo-img {
  height: 44px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

/* === FOOTER ============================================== */
#site-footer {
  background: var(--color-secondary);
  color: rgba(255,255,255,0.85);
  padding-block: var(--space-16) var(--space-8);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  margin-block: var(--space-6);
}

.footer-nav a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.8);
  transition: color var(--transition);
}
.footer-nav a:hover { color: var(--color-white); }

.footer-copy {
  border-top: 1px solid rgba(255,255,255,0.25);
  padding-top: var(--space-6);
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.65);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-xl);
  color: var(--color-white);
  display: block;
  margin-bottom: var(--space-4);
}
.footer-logo span { color: var(--color-white); opacity: 0.75; }

.footer-brand p {
  font-size: var(--text-sm);
  line-height: 1.75;
  color: rgba(255,255,255,0.75);
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: var(--space-5);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.footer-col ul li { margin-bottom: var(--space-3); }
.footer-col a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.75);
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--color-white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.25);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.6);
}

/* === RESPONSIVE ========================================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }

  .header-nav  { display: none; }
  .header-auth { display: none; }
  .header-menu-toggle { display: flex; }

  .section { padding-block: var(--space-12); }
  .section-title { font-size: var(--text-3xl); }

  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer-bottom { flex-direction: column; gap: var(--space-3); text-align: center; }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
  .container { padding-inline: var(--space-4); }
}
