/**
 * Proyectos Técnicos Sostenibles - Stylesheet
 * Archivo: styles.css
 * Descripción: Estilos principales del sitio web
 */

/* ====================================
   VARIABLES CSS
   ==================================== */
:root {
  --bg: #0b1220;          /* blue-black */
  --card: #0f172a;        /* slate-900 */
  --muted: #cbd5e1;       /* slate-300 - mejor contraste WCAG AA */
  --text: #f1f5f9;        /* slate-100 - más brillante */
  --brand: #0ea5e9;       /* sky-500 - azul profesional */
  --accent: #10b981;      /* emerald-500 - innovación sostenible */
  --ok: #34d399;          /* emerald-400 */
  --warn: #f59e0b;        /* amber-500 */
}

/* ====================================
   RESET Y BASE
   ==================================== */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, rgba(56, 189, 248, .15), transparent 60%), 
              linear-gradient(180deg, #0b1220, #0b1220);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ====================================
   LAYOUT
   ==================================== */
.container {
  inline-size: clamp(320px, 80vw, 1320px);
  margin: 0 auto;
  padding: 0 20px;
}

/* ====================================
   HEADER Y NAVEGACIÓN
   ==================================== */
header {
  position: sticky;
  top: 0;
  backdrop-filter: saturate(140%) blur(10px);
  background: rgba(11, 18, 32, .95);
  border-bottom: 1px solid rgba(14, 165, 233, .15);
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 0 rgba(14, 165, 233, .1);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}

.logo {
  inline-size: 36px;
  block-size: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

.logoimg {
  inline-size: 36px;
  block-size: 36px;
  object-fit: contain;
  display: block;
}

.brand h1 {
  font-size: 16px;
  margin: 0;
  font-weight: 700;
}

.navlinks {
  display: flex;
  gap: 18px;
}

/* ====================================
   BOTONES
   ==================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .18);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, .6);
  box-shadow: 0 4px 12px rgba(14, 165, 233, .2);
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #0b1220;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(14, 165, 233, .3);
}

.btn.primary:hover {
  box-shadow: 0 6px 16px rgba(14, 165, 233, .4), 0 2px 4px rgba(16, 185, 129, .2);
  transform: translateY(-2px);
}

/* ====================================
   HERO SECTION
   ==================================== */
.hero {
  padding: 100px 0 60px;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.1;
  margin: 0 0 20px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero h2 {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.1;
  margin: 0 0 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--muted);
  max-width: 780px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(14, 165, 233, .15);
  color: #7dd3fc;
  border: 1px solid rgba(14, 165, 233, .3);
  font-weight: 600;
  margin-bottom: 18px;
  font-size: 14px;
}

/* ====================================
   GRID Y CARDS
   ==================================== */
.grid {
  display: grid;
  gap: 20px;
}

.cards {
  grid-template-columns: repeat(12, 1fr);
}

.card {
  grid-column: span 4;
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, .1);
  border-radius: 18px;
  padding: 24px;
  min-height: 180px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(14, 165, 233, .4);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(14, 165, 233, .1);
}

.card h3 {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.card p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.6;
}

.card p:last-child {
  margin-bottom: 0;
}

.card .kicker {
  display: inline-block;
  font-size: 12px;
  color: #7dd3fc;
  margin-bottom: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card:after {
  content: "";
  position: absolute;
  inset: auto -20% -60% auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(120px 120px at 50% 50%, rgba(14, 165, 233, .15), transparent 60%);
  transition: all 0.3s ease;
}

.card:hover:after {
  background: radial-gradient(120px 120px at 50% 50%, rgba(16, 185, 129, .12), transparent 60%);
}

.card .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 32px;
  block-size: 32px;
  border-radius: 999px;
  background: rgba(14, 165, 233, .15);
  border: 1px solid rgba(14, 165, 233, .3);
  margin-bottom: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.card:hover .icon {
  background: rgba(16, 185, 129, .15);
  border-color: rgba(16, 185, 129, .4);
  transform: scale(1.05);
}

.ico {
  inline-size: 18px;
  block-size: 18px;
  stroke: var(--brand);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s ease;
}

.card:hover .ico {
  stroke: var(--accent);
}

/* ====================================
   SECTIONS
   ==================================== */
.section {
  padding: 80px 0;
}

.section h2 {
  font-size: clamp(24px, 4vw, 36px);
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section p.lead {
  color: var(--muted);
  max-width: 760px;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.6;
}

.list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.list li {
  list-style: none;
  padding: 12px 14px;
  border: 1px dashed rgba(148, 163, 184, .25);
  border-radius: 12px;
  transition: all 0.3s ease;
  line-height: 1.6;
}

.list li:hover {
  border-color: rgba(14, 165, 233, .4);
  background: rgba(14, 165, 233, .03);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.note {
  font-size: 14px;
  color: var(--muted);
}

/* ====================================
   TAGS Y PILLS
   ==================================== */
.tag {
  display: inline-block;
  font-size: 13px;
  color: #0b1220;
  background: linear-gradient(135deg, #10b981, #34d399);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(16, 185, 129, .3);
}

.pill {
  display: inline-block;
  font-size: 12px;
  color: #0b1220;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 700;
}

/* ====================================
   FORMULARIOS
   ==================================== */
.form {
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 18px;
  padding: 20px;
}

.form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 14px;
  color: var(--muted);
}

.input,
.textarea,
select {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(2, 6, 23, .25);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  font-family: inherit;
  font-size: inherit;
  transition: all 0.3s ease;
}

.input:focus,
.textarea:focus {
  border-color: rgba(14, 165, 233, .6);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, .15);
  background: rgba(2, 6, 23, .4);
}

.help {
  font-size: 12px;
  color: var(--muted);
}

.alert {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, .25);
  display: none;
  font-weight: 500;
}

.alert.ok {
  border-color: rgba(16, 185, 129, .5);
  background: rgba(16, 185, 129, .1);
  color: #6ee7b7;
}

.alert.err {
  border-color: rgba(245, 158, 11, .5);
  background: rgba(245, 158, 11, .1);
  color: #fcd34d;
}

/* ====================================
   FOOTER
   ==================================== */
footer {
  padding: 40px 0;
  border-top: 1px solid rgba(148, 163, 184, .12);
  background: rgba(2, 6, 23, .4);
}

.footgrid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 20px;
}

ul.clean {
  margin: 8px 0 0;
  padding: 0;
}

ul.clean li {
  list-style: none;
  margin: 6px 0;
}

/* ====================================
   COOKIE BANNER
   ==================================== */
#cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  display: none;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(11, 18, 32, .96);
  border-top: 1px solid rgba(148, 163, 184, .2);
}

#cookie-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  flex: 1;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cookie-btn:hover {
  border-color: rgba(14, 165, 233, .5);
}

.cookie-btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #0b1220;
  border-color: transparent;
  font-weight: 700;
}

.cookie-btn.primary:hover {
  box-shadow: 0 4px 12px rgba(14, 165, 233, .3);
}

.cookie-link {
  color: var(--brand);
  text-decoration: underline;
  transition: color 0.3s ease;
}

.cookie-link:hover {
  color: var(--accent);
}

.cookie-prefs {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

#cookie-banner.open .cookie-prefs {
  display: block;
}

/* ====================================
   BANNER SUBVENCIONES
   ==================================== */
.subv-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  max-width: 320px;
  background: var(--card);
  border: 1px solid rgba(14, 165, 233, .3);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(14, 165, 233, .15);
  z-index: 999;
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.subv-banner.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.subv-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.subv-close:hover {
  color: var(--text);
}

.subv-content {
  padding-right: 20px;
}

.subv-title {
  display: block;
  color: var(--brand);
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 700;
}

.subv-text {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.subv-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #0b1220;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(14, 165, 233, .3);
}

.subv-btn:hover {
  box-shadow: 0 4px 12px rgba(14, 165, 233, .4);
  transform: translateY(-1px);
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 960px) {
  .card {
    grid-column: span 6;
  }

  .footgrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .card {
    grid-column: span 12;
  }

  nav .navlinks {
    display: none;
  }

  .list {
    grid-template-columns: 1fr;
  }

  .form .row {
    grid-template-columns: 1fr;
  }

  .subv-banner {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

