/* =====================
   Ranquel Tech Lab - Estilos Globales
   Archivo: styles.css
   ===================== */

/* Variables CSS */
:root {
  --bg: #0b0d10;
  --bg-2: #0f1216;
  --surface: #10151b;
  --border: #1e2a33;
  --text: #e6f4ff;
  --text-muted: #a7c2cf;
  --accent: #22ccff;
  --accent-600: #14b3e6;
  --accent-700: #0aa3d6;
  --ink-on-accent: #001218;
  --accent-rgb: 34 204 255;
  --bg-rgb: 11 13 16;
  --text-rgb: 230 244 255;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background: 
    radial-gradient(1000px 600px at 85% -120px, rgba(34,204,255,.18), transparent),
    radial-gradient(800px 400px at 10% -80px, rgba(34,204,255,.10), transparent),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Inter, Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  border-radius: 16px;
  padding: .7rem 1rem;
  font-weight: 600;
  min-height: 44px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-accent {
  background: var(--accent);
  color: var(--ink-on-accent);
  box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 24px rgba(34,204,255,.25);
}

.btn-accent:hover {
  background: var(--accent-600);
  transform: translateY(-2px);
}

.btn-accent:active {
  background: var(--accent-700);
  transform: translateY(0);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: transparent;
}

.btn-ghost:hover {
  background: rgba(34,204,255,.08);
  border-color: var(--accent);
}

.neon {
  text-shadow: 0 0 18px rgba(34,204,255,.35);
}

.glow {
  box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 32px rgba(34,204,255,.12);
}

.badge {
  display: inline-block;
  border: 1px solid var(--border);
  padding: .25rem .6rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(34,204,255,.18), rgba(34,204,255,.05));
  color: var(--text);
  font-size: .875rem;
  width: fit-content;
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

header.backdrop {
  backdrop-filter: saturate(150%) blur(10px);
  background: rgba(15,18,22,.65);
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}

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

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

.lang-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px 8px 40px;
  font-weight: 600;
  cursor: pointer;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: 12px center;
}

.lang-select[data-flag="es"] {
  background-image: url('./images/flag-es.svg');
}

.lang-select[data-flag="en"] {
  background-image: url('./images/flag-en.svg');
}

.nav-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.nav-whatsapp svg {
  width: 18px;
  height: 18px;
}

.visually-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

header .logo {
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--text);
  text-decoration: none;
}

.mobile-menu {
  border-top: 1px solid var(--border);
}

.mobile-menu ul {
  padding: 8px 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.mobile-menu a {
  display: block;
  padding: 8px 12px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s ease;
}

.mobile-menu a:hover {
  background: rgba(34,204,255,.1);
}

a:focus, button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(34,204,255,.18), rgba(34,204,255,.06));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb svg {
  width: 70%;
  height: 70%;
  color: var(--text);
}

.thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* HERO SECTION IMPROVED */
#hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('./images/Portada.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.7; /* 70% de opacidad */
  filter: blur(2px) brightness(0.7);
  z-index: -1;
}

#hero .wrap {
  padding-top: 80px;
  padding-bottom: 80px;
  position: relative;
  z-index: 2;
  max-width: min(77vw, 1200px);
  margin-left: clamp(1rem, 4vw, 2.5rem);
  margin-right: auto;
}

.hero-content {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .hero-content {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

.hero-text {
  display: grid;
  gap: 1rem;
  text-align: left;
  max-width: min(90vw, 1100px);
}

#hero h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: .2px;
  margin-top: 12px;
  max-width: 840px;
  line-height: 1.1;
}

#hero .hero-subtitle {
  margin-top: 12px;
  color: #f3f7ff;
  max-width: 820px;
  font-size: 18px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65), 0 0 6px rgba(0, 0, 0, 0.45);
  -webkit-text-stroke: 0.3px rgba(255, 255, 255, 0.9);
  text-align: left;
}

@media (max-width: 1023px) {
  #hero .wrap {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-text,
  #hero h1,
  #hero .hero-subtitle {
    max-width: 100%;
  }
}

@media (min-width: 1024px) {
  #hero h1 {
    font-size: clamp(38px, 4vw, 50px);
    line-height: 1.05;
  }
}

#hero .hero-buttons {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-padding {
  padding-top: 64px;
  padding-bottom: 64px;
}

.section-title {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 700;
  text-align: center;
}

.text-center {
  text-align: center;
}

.about-grid {
  display: grid;
  gap: 1rem;
  margin-top: 16px;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

.about-grid p {
  margin-top: 12px;
  color: var(--text-muted);
}

#services .panel h3 {
  font-size: 18px;
  font-weight: 700;
}

#services .panel p {
  margin-top: 4px;
  color: var(--text-muted);
}

#ia p {
  margin-top: 12px;
  color: var(--text-muted);
  max-width: 960px;
  margin-inline: auto;
}

#ia .panel h3 {
  font-size: 18px;
  font-weight: 700;
}

#ia .panel p {
  color: var(--text-muted);
}

.marketing-subtitle {
  margin-top: 12px;
  color: var(--text-muted);
  max-width: 960px;
  margin-inline: auto;
}

.marketing-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 22px;
}

.marketing-icon {
  height: 48px;
  width: auto;
}

.metodo-grid {
  display: grid;
  gap: 1rem;
  margin-top: 24px;
  align-items: start;
}

@media (min-width: 768px) {
  .metodo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .step {
    max-width: min(560px, 95%);
  }
  
  .step-left {
    justify-self: end;
    transform: translateX(-6px);
  }
  
  .step-right {
    justify-self: start;
    transform: translateX(6px);
  }
}

.step .thumb {
  margin-top: 8px;
}

.step h3 {
  font-weight: 700;
}

.step p {
  white-space: pre-wrap;
  margin-top: 2px;
  color: var(--text-muted);
  font-family: inherit;
}

#vistaOpciones ul {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  list-style: none;
}

#vistaOpciones li {
  color: var(--text-muted);
}

#vistaOpciones h3 {
  font-weight: 700;
}

.cta-rail {
  border: 1px dashed var(--border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(34,204,255,.07), rgba(34,204,255,.03));
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.cta-rail > div {
  display: grid;
  gap: 6px;
}

.cta-title {
  font-size: clamp(18px, 2.5vw, 22px);
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.footer-content {
  padding: 24px 0 96px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
}

.footer-icons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  transition: all 0.2s ease;
  font-weight: 600;
  background: rgba(34,204,255,0.04);
}

.footer-phone:hover {
  border-color: var(--accent);
  background: rgba(34,204,255,.1);
  transform: translateY(-1px);
}

.footer-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer-icon:hover {
  background: rgba(34,204,255,.1);
  border-color: var(--accent);
  transform: translateY(-2px);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: transform .6s ease, opacity .6s ease;
}

.reveal-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.mapa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.mapa-embed {
  margin-top: 12px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 70px rgba(0,0,0,0.28);
}

@media (max-width: 640px) {
  #hero .hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  #hero .btn {
    justify-content: center;
  }
}

img {
  background: linear-gradient(90deg, var(--surface), var(--border), var(--surface));
}
/* Chatbot Ranquel Tech Lab */
#chatbot-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.chatbot-toggle {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: #7c3aed;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.chatbot-panel {
  margin-top: 8px;
  width: min(360px, 92vw);
  max-height: min(75vh, 540px);
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  font-size: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 640px), (max-height: 600px) {
  .chatbot-panel {
    max-height: calc(100vh - 110px);
  }
}

@media (orientation: landscape) and (max-width: 900px) {
  #chatbot-container {
    right: 10px;
    bottom: 10px;
  }

  .chatbot-panel {
    width: min(440px, 88vw);
    max-height: 70vh;
  }
}

.chatbot-hidden {
  display: none;
}

.chatbot-input,
.chatbot-select,
.chatbot-textarea {
  width: 100%;
  margin-top: 4px;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: none;
  background: #020617;
  color: #e5e7eb;
  font-size: 12px;
}

.chatbot-textarea {
  min-height: 80px;
  resize: vertical;
}

.chatbot-btn-primary {
  width: 100%;
  padding: 8px;
  border-radius: 999px;
  border: none;
  background: #7c3aed;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  margin-top: 4px;
}

.chatbot-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot-btn-link {
  width: 100%;
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 2px;
  text-align: center;
}

.chatbot-badge {
  font-size: 11px;
  color: #a5b4fc;
}

.chatbot-legal {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 4px 0;
}
