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

:root {
  color-scheme: only light !important;
  --primary:       #008d9a;
  --primary-dark:  #006b75;
  --primary-light: #00a8b8;
  --accent:        #00c2d4;
  --bg:            #f4f6f7;
  --bg-card:       #ffffff;
  --text:          #1a2326;
  --text-muted:    #6b7f83;
  --text-light:    #9bb0b4;
  --border:        #dde4e6;
  --border-strong: #c5d1d4;
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  background: var(--bg);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

html[data-theme='dark'] {
  --primary:       #18b8c7;
  --primary-dark:  #d8f7fa;
  --primary-light: #59d2dc;
  --accent:        #43d4e2;
  --bg:            #091316;
  --bg-card:       #112025;
  --text:          #eef7f8;
  --text-muted:    #bfd0d3;
  --text-light:    #8ea7ac;
  --border:        #274248;
  --border-strong: #3c5e65;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 3;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(8, 24, 28, 0.68);
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.theme-toggle:hover {
  background: rgba(8, 24, 28, 0.82);
  border-color: rgba(255,255,255,0.34);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

html[data-theme='dark'] .theme-toggle {
  background: rgba(232, 245, 247, 0.1);
}

html.auto-dark-forced,
html.auto-dark-forced body {
  background: var(--bg) !important;
  color: var(--text) !important;
}

html.auto-dark-forced .bg-scene,
html.auto-dark-forced .card,
html.auto-dark-forced .badge,
html.auto-dark-forced .contact-item,
html.auto-dark-forced .contact-icon,
html.auto-dark-forced .logo-placeholder,
html.auto-dark-forced .footer-msg {
  color-scheme: only light !important;
}

html.auto-dark-forced .bg-scene {
  background: var(--bg) !important;
}

html.auto-dark-forced .bg-top-band {
  background: var(--primary) !important;
}

html.auto-dark-forced .bg-band-border,
html.auto-dark-forced .divider,
html.auto-dark-forced .card::before,
html.auto-dark-forced .badge-dot {
  background: var(--primary) !important;
}

html.auto-dark-forced .card {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: var(--border) !important;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.07),
    0 20px 56px rgba(0,0,0,0.09) !important;
}

html.auto-dark-forced .card,
html.auto-dark-forced .card p,
html.auto-dark-forced .card h1,
html.auto-dark-forced .card strong,
html.auto-dark-forced .card span,
html.auto-dark-forced .card a {
  color-scheme: only light !important;
  -webkit-text-fill-color: currentColor;
}

html.auto-dark-forced .headline,
html.auto-dark-forced .main-message strong,
html.auto-dark-forced .contact-value {
  color: var(--text) !important;
}

html.auto-dark-forced .headline span {
  color: var(--primary) !important;
}

html.auto-dark-forced .subheadline,
html.auto-dark-forced .contact-label,
html.auto-dark-forced .contact-title,
html.auto-dark-forced .footer-msg {
  color: var(--text-light) !important;
}

html.auto-dark-forced .main-message,
html.auto-dark-forced .footer-msg strong {
  color: var(--text-muted) !important;
}

html.auto-dark-forced .badge {
  background: #eaf6f7 !important;
  border-color: #b8e4e8 !important;
  color: var(--primary-dark) !important;
}

html.auto-dark-forced .contact-item,
html.auto-dark-forced .logo-placeholder {
  background: var(--bg) !important;
  border-color: var(--border) !important;
}

html.auto-dark-forced .contact-icon {
  background: #daf0f3 !important;
}

html.auto-dark-forced .contact-icon svg {
  stroke: var(--primary-dark) !important;
}

html[data-theme='dark'] .logo-placeholder {
  background: linear-gradient(180deg, #0d3c43 0%, #006b75 100%) !important;
  border-color: #43b8c3 !important;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

html[data-theme='dark'] .logo-placeholder img.loaded {
  filter: none !important;
  opacity: 1 !important;
}

html[data-theme='dark'] .contact-icon {
  background: #005762 !important;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
}

html[data-theme='dark'] .contact-icon svg {
  stroke: #ffffff !important;
  stroke-width: 2.35;
  filter: drop-shadow(0 0 1px rgba(255,255,255,0.22));
}

html[data-theme='dark'] .contact-item:hover .contact-icon {
  background: #008d9a !important;
}

html[data-theme='dark'] .bg-scene,
html[data-theme='dark'] body,
html[data-theme='dark'] html {
  background: var(--bg);
}

html[data-theme='dark'] .bg-top-band {
  background: linear-gradient(180deg, #0b5c66 0%, #0a4249 100%);
}

html[data-theme='dark'] .card,
html[data-theme='dark'] .card::after {
  background: var(--bg-card) !important;
}

html[data-theme='dark'] .card {
  border-color: var(--border);
  box-shadow:
    0 8px 24px rgba(0,0,0,0.28),
    0 28px 72px rgba(0,0,0,0.38);
}

html[data-theme='dark'] .badge {
  background: rgba(24,184,199,0.12);
  border-color: rgba(89,210,220,0.28);
  color: #d6f9fb;
}

html[data-theme='dark'] .contact-item {
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
}

html[data-theme='dark'] .contact-item:hover {
  background: rgba(24,184,199,0.1);
  border-color: var(--primary-light);
}

html[data-theme='dark'] .footer-msg {
  border-top-color: var(--border);
}

/* ===========================
   BACKGROUND — franja sólida superior
=========================== */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
  overflow: hidden;
}

.bg-top-band {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  background: var(--primary);
}

/* Patrón de puntos — manejado por canvas en JS */
.bg-dot-canvas {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 40%;
  overflow: hidden;
}

.bg-dot-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Línea de acento al pie de la franja */
.bg-band-border {
  position: absolute;
  top: calc(40% - 2px);
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--accent) 60%, transparent 100%);
  opacity: 0.7;
}

/* ===========================
   MAIN LAYOUT
=========================== */
.page-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

/* ===========================
   CARD
=========================== */
.card {
  forced-color-adjust: none !important;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
  
  width: 100%;
  max-width: 700px;
  background: var(--bg-card);
  background-color: #ffffff !important;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 52px 60px;
  text-align: center;
  position: relative;
  isolation: isolate;
  color-scheme: only light;
  box-shadow:
    0 4px 16px rgba(0,0,0,0.07),
    0 20px 56px rgba(0,0,0,0.09);

  opacity: 0;
  animation: cardReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

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

/* Línea de acento en el tope de la card */
.card::before {
  content: '';
  position: absolute;
  top: -1px; left: 48px; right: 48px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: #ffffff;
}

.card,
.card p,
.card h1,
.card strong,
.card span,
.card a {
  color-scheme: only light;
}

/* ===========================
   LOGO ZONE
=========================== */
.logo-zone {
  margin-bottom: 28px;
  animation: fadeUp 0.7s ease 0.25s both;
}

.logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 150px;
  border-radius: 12px;
  border: 2px dashed var(--border-strong);
  background: var(--bg);
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  overflow: hidden;
}

.logo-placeholder:hover {
  border-color: var(--primary);
  background: #ecf7f8;
}

.logo-placeholder img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 10px;
  display: none;
}
.logo-placeholder img.loaded { display: block; }

.logo-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}
.logo-icon svg { opacity: 0.3; }
.logo-icon span {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
}

.logo-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ===========================
   BADGE
=========================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eaf6f7;
  border: 1px solid #b8e4e8;
  border-radius: 100px;
  padding: 5px 13px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 20px;
  animation: fadeUp 0.7s ease 0.35s both;
}

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulseDot 2.4s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,141,154,0.45); }
  55%       { opacity: 0.7; box-shadow: 0 0 0 5px rgba(0,141,154,0); }
}

/* ===========================
   TIPOGRAFÍA
=========================== */
.headline {
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: clamp(32px, 5.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 6px;
  animation: fadeUp 0.7s ease 0.42s both;
}

.headline span { color: var(--primary); }

.subheadline {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-light);
  letter-spacing: 0.01em;
  margin-bottom: 24px;
  animation: fadeUp 0.7s ease 0.5s both;
}

/* ===========================
   DIVIDER
=========================== */
.divider {
  width: 36px; height: 2px;
  background: var(--primary);
  margin: 0 auto 24px;
  border-radius: 2px;
  animation: dividerReveal 0.7s ease 0.58s both;
}

@keyframes dividerReveal {
  from { width: 0; opacity: 0; }
  to   { width: 36px; opacity: 1; }
}

/* ===========================
   MENSAJE PRINCIPAL
=========================== */
.main-message {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 32px;
  animation: fadeUp 0.7s ease 0.62s both;
}

.main-message strong {
  color: var(--text);
  font-weight: 600;
}

/* ===========================
   CONTACTO
=========================== */
.contact-section {
  margin-bottom: 32px;
  animation: fadeUp 0.7s ease 0.7s both;
}

.contact-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 12px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}
.contact-grid > *:last-child {
  grid-column: 1 / -1;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px 15px;
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
  min-width: 0;
}

.contact-item span,
.contact-item p {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  min-width: 0;
}

.contact-item:hover {
  border-color: var(--primary-light);
  background: #ecf7f8;
}

.contact-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: #daf0f3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.contact-item:hover .contact-icon { background: #c0e6eb; }

.contact-icon svg {
  width: 15px; height: 15px;
  stroke: var(--primary-dark);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contact-info { overflow: hidden; }

.contact-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 1px;
}

.contact-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===========================
   FOOTER
=========================== */
.footer-msg {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.75;
  animation: fadeUp 0.7s ease 0.78s both;
}

.footer-msg strong {
  color: var(--text-muted);
  font-weight: 500;
}

/* ===========================
   ANIMACIONES BASE
=========================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================
   RESPONSIVE
=========================== */
@media (max-width: 580px) {
  .theme-toggle {
    top: 14px;
    right: 14px;
    padding: 9px 13px;
    font-size: 11px;
  }

  .card {
    padding: 36px 22px 32px;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .bg-top-band { height: 100%; }
  .bg-dot-pattern,
  .bg-band-border { height: 30%; }
}

@media (max-width: 360px) {
  .card { padding: 28px 16px 24px; }
  .headline { font-size: 28px; }
}

@media (min-width: 1100px) {
  .card { max-width: 760px; padding: 60px 76px; }
}
