<!-- Estilos personalizados -->
<style>
    * { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; scroll-behavior: smooth; font-family: 'Inter', sans-serif; }

body {
  background: linear-gradient(to right, #f0f2f5, #e0e0e0);
  color: #333;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

/* Contenedor flexible para formularios */
.contenedor-formularios {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* centra los formularios */
  gap: 20px;               /* espacio entre ellos */
}

/* Formularios principales: ambos igual tamaño */
.frame, form.contact {
  background-color: #dce9f9;
  color: #000;
  border-radius: 8px;
  padding: 20px;
  flex: 1 1 45%;       /* base 45% para que se vean lado a lado en desktop */
  max-width: 550px;    /* ancho máximo más grande */
  min-width: 320px;    /* ancho mínimo seguro en móviles */
  box-shadow: 0 8px 20px rgba(0,0,0,0.07);
  border: 1px solid #c7d7e6;
  box-sizing: border-box;
}

/* Ajuste de margenes automáticos para centrar si solo hay uno en la fila */
.frame:nth-child(odd), form.contact:nth-child(odd) {
  margin: 0 auto;
}

/* Inputs y textarea dentro de los dos primeros formularios */
.frame input,
.frame textarea,
form.contact input,
form.contact textarea {
  width: 100%;           /* se ajusta al ancho del formulario */
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
}

/* Responsive: tablet y pantallas medianas */
@media (max-width: 900px) {
  .frame, form.contact {
    flex: 1 1 48%;      /* un poco más flexible */
    max-width: 480px;    /* límite medio */
  }
}

/* Responsive: pantallas pequeñas (móvil) */
@media (max-width: 640px) {
  .contenedor-formularios {
    flex-direction: column; /* apilan verticalmente */
    align-items: center;
    gap: 15px;
  }
  .frame, form.contact {
    width: 90%;          /* ocupan la mayor parte del ancho disponible */
    max-width: 400px;    /* límite seguro en móviles */
    flex: none;          /* evita que se encojan */
  }
}

h2 { text-align: center; margin-bottom: 10px; font-size: 18px; }
label { display: block; margin-top: 10px; font-weight: 600; font-size: 14px; }
input, textarea { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #ccc; border-radius: 8px; font-size: 13px; }

.intro-header, .how-it-works { max-width: 800px; margin: 2rem auto; padding: 0 1rem; text-align: center; }
.intro-header h1 { color: #2d2d2d; font-size: 1.8rem; } 
.intro-header p { color: #555; font-size:1rem; line-height:1.5; }
.how-it-works { font-size:1rem; line-height:1.3; color:#555; }
.how-it-works h2 { font-size:1.2rem; margin-bottom:0.8rem; color:#2d2d2d; } 
.how-it-works h3 { margin:1rem 0 0.4rem; color:#2d2d2d; }
.how-it-works ul { padding-left:1.2rem; list-style-type:disc; list-style-position:inside; text-align:left; display:inline-block; }

/* Botones generales */
.btns { margin-top: 15px; display: flex; flex-wrap: wrap; gap: 10px; }
button {
  flex: 1 1 auto;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  white-space: nowrap;
  max-width: 90%;
}
button:hover { transform: scale(1.03); }

/* Botones específicos por orden */
button:nth-child(1) { background-color: #28a745; } /* Calcular */
button:nth-child(1):hover { background-color: #218838; }
button:nth-child(2) { background-color: #ffc107; } /* Vaciar */
button:nth-child(2):hover { background-color: #e0a800; }
button:nth-child(3) { background-color: #dc3545; } /* Borrar historial */
button:nth-child(3):hover { background-color: #c82333; }
button:nth-child(4) { background-color: #64b5f6; } /* Imprimir */
button:nth-child(4):hover { background-color: #42a5f5; }
button:nth-child(5) { background-color: #343a40; } /* Exportar PDF */
button:nth-child(5):hover { background-color: #23272b; }

button:active {
  transform: scale(0.92);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25) inset;
  animation: pulse 0.25s ease;
}
@keyframes pulse { 0% { transform: scale(0.92); } 50% { transform: scale(0.97); } 100% { transform: scale(0.92); } }

/* Resultado de cálculos */
.resultado {
  margin-top: 15px;
  font-weight: bold;
  background-color: #f8f9fa;
  border-left: 5px solid #007bff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

/* Botones especiales */
.print-btn { background-color: #28a745; }
.print-btn:hover { background-color: #1e7e34; }
.pdf-btn { background-color: #6c757d; }
.pdf-btn:hover { background-color: #5a6268; }

/* Contenedor del toggle */
.theme-container {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 999;
  text-align: center;
  font-family: sans-serif;
}

/* Switch base */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 34px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider */
.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 34px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.4s;
}

/* Bola del slider */
.slider::before {
  content: "";
  position: absolute;
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

/* Íconos dentro del toggle */
.icon-left, .icon-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  pointer-events: none;
}
.icon-left { left: 8px; }
.icon-right { right: 8px; }

/* Cuando está activo (modo oscuro) */
.theme-switch input:checked + .slider {
  background-color: #666;
}

.theme-switch input:checked + .slider::before {
  transform: translateX(36px);
}

/* Texto debajo del toggle */
.theme-label {
  margin-top: 6px;
  font-size: 14px;
  color: #333;
}

/* Ajustes responsive */
@media (max-width: 640px) {
  .theme-switch { width: 50px; height: 28px; }
  .slider::before { width: 22px; height: 22px; }
  .icon-left, .icon-right { font-size: 16px; }
  .theme-label { font-size: 13px; }
}

/* Modo oscuro para el label */
body.modo-oscuro .theme-label {
  color: #e8e8e8;
}
body.modo-claro .theme-label {
  color: #333;
}


/* Checkboxes personalizados */
.checkbox-container { display: inline-flex; align-items: center; cursor: pointer; font-weight: 500; font-size: 15px; gap: 8px; user-select: none; transition: all 0.3s ease; }
.checkbox-container input[type="checkbox"] { display: none; }
.custom-checkbox {
  width: 20px; height: 20px; border: 2px solid #777; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.25s ease-in-out;
  background-color: #e6e6e6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.checkbox-container:hover .custom-checkbox { transform: translateY(-2px) scale(1.05); box-shadow: 0 4px 8px rgba(0,0,0,0.25); }
.checkbox-container input[type="checkbox"]:checked + .custom-checkbox {
  background-color: #4caf50; border-color: #4caf50; box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.custom-checkbox::after { content: "✓"; font-size: 14px; font-weight: bold; color: white; display: none; }
.checkbox-container input[type="checkbox"]:checked + .custom-checkbox::after { display: block; }
.checkbox-text { transition: color 0.3s ease, transform 0.2s ease; color: #000; }
.checkbox-container:hover .checkbox-text { color: #4caf50; transform: translateY(-2px); }

:root {
  --bg-light: #f0f2f5; --text-light: #1f1f1f; --input-bg-light: #fff; --border-light: #ccc;
  --bg-dark: #1f1f1f; --text-dark: #e8e8e8; --toggle-bg: #ffffff; --toggle-text: #333;
}

/* 🌞 Modo claro */
body.modo-claro { background: var(--bg-light); color: var(--text-light); }
body.modo-claro input, body.modo-claro textarea { background: var(--input-bg-light); color: var(--text-light); border: 1px solid var(--border-light); }
body.modo-claro label { color: var(--text-light); }

/* 🌙 Modo oscuro */
body.modo-oscuro { background: #1c1c1c; color: #f0f0f0; }
body.modo-oscuro .frame, body.modo-oscuro form.contact { background-color: #d0d0d0 !important; color: #000 !important; border: 1px solid #999; }
body.modo-oscuro input, body.modo-oscuro textarea, body.modo-oscuro select { background-color: #e6e6e6 !important; color: #000 !important; border: 1px solid #888; }
body.modo-oscuro label, body.modo-oscuro .frame label, body.modo-oscuro form.contact label { color: #000 !important; }
body.modo-oscuro .resultado { background-color: #3a3a3a; color: #fff; border-left: 5px solid #4ea1ff; }

/* Footer modo oscuro */
body.modo-oscuro .footer-bottom { color: #94a3b8 !important; border-color: #334155 !important; }
body.modo-oscuro .footer-links a:hover { color: #0056b3; }
body.modo-oscuro .footer-links a:hover svg { fill: #0056b3; }
body.modo-oscuro footer.bg-gray-100 { background-color: transparent !important; color: #e0e7ff !important; }

/* Publicidad */
.adsense-box {
  margin: 20px auto;
  max-width: 1200px;
  background: #fff;
  border: 1px dashed #ccc;
  padding: 20px;
  text-align: center;
  border-radius: 12px;
}

/* Footer actualizado */
.footer-bottom {
  font-size: 0.8rem;
  text-align: center;
  color: #666;
  border-top: 1px solid #ccc;
  padding: 0.8rem 0 2rem;
  margin-top: 1rem;
  position: relative;
  z-index: 10;
  background-color: inherit;
  width: 100%;
}
.footer-links {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}
.footer-links a {
  color: #6b9ac4;
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  transition: color 0.3s ease;
}
.footer-links a:hover { color: #0056b3; }
.footer-links svg { fill: currentColor; }

/* Scroll suave */
html { scroll-behavior: smooth; }

/* Contenedores y layout responsive */
.contenedor-formularios { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }

@media (max-width: 640px) {
  .contenedor-formularios { flex-direction: column; }
  .frame { width: 100%; max-width: 100%; margin-bottom: 20px; }

  /* Botones en exactamente 2 columnas */
  .btns { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
    justify-items: center; /* centra los botones en sus celdas */
    width: 100%;
  }
  .btns button { 
    flex: none; 
    width: 100%; 
    max-width: 200px; 
    min-width: 120px; 
  }
  /* Centrar el último botón si queda solo */
  .btns button:last-child:nth-child(odd) {
    grid-column: 1 / -1; 
    justify-self: center;
  }

  footer { padding: 1rem; font-size: 0.95rem; }
  .toggle-btn { font-size: 0.85rem; padding: 0.3rem 0.6rem; max-width: 100%; }
  .how-it-works ul { list-style-type: none; padding-left: 0; text-align: center; }
}

/* Estilos generales header y sección "Cómo funciona" */
.intro-header { max-width: 800px; margin: 2rem auto; padding: 0 1rem; text-align: center; }
.intro-header h1 { color: #2d2d2d; font-size: 1.8rem; }
.intro-header p { color: #555; font-size: 1rem; line-height: 1.5; }
body.modo-oscuro .intro-header h1 { color: #d1d5db; }
body.modo-oscuro .intro-header p { color: #9ca3af; }

.how-it-works { max-width: 800px; margin: 2rem auto; padding: 0 1rem; font-size: 1rem; line-height: 1.3; color: #555; text-align: center; }
.how-it-works h2 { font-size: 1.2rem; margin-bottom: 0.8rem; color: #2d2d2d; }
.how-it-works h3 { margin-top: 1rem; margin-bottom: 0.4rem; color: #2d2d2d; }
.how-it-works ul { padding-left: 1.2rem; list-style-type: disc; list-style-position: inside; text-align: left; display: inline-block; }
body.modo-oscuro .how-it-works { color: #9ca3af; }
body.modo-oscuro .how-it-works h2, body.modo-oscuro .how-it-works h3 { color: #d1d5db; }

/* Iconos fila */
.icon-row-solo { display: flex; justify-content: space-evenly; align-items: center; margin: 20px 0; gap: 10px; }
.icon-row-solo img { max-width: 70px; height: auto; flex: 1 1 auto; object-fit: contain; border-radius: 6px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15)); transition: transform 0.3s ease; }
.icon-row-solo img:hover { transform: scale(1.15); }

/* ===== Botones de copiar: Binance y USDT ===== */

/* Botón gris por defecto */
#binance-box button,
#usdt-box button {
  background-color: #6c757d; /* gris suave */
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Hover: ligeramente más oscuro */
#binance-box button:hover,
#usdt-box button:hover {
  background-color: #5a6268; /* gris más oscuro */
  transform: scale(1.05);
}

/* Efecto al presionar (pulsación) */
#binance-box button:active,
#usdt-box button:active {
  transform: scale(0.92);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25) inset;
  animation: pulse 0.25s ease;
}

@keyframes pulse {
  0% { transform: scale(0.92); }
  50% { transform: scale(0.97); }
  100% { transform: scale(0.92); }
}

/* Verde cuando se copia */
#binance-box button.copiado,
#usdt-box button.copiado {
  background-color: #4caf50 !important;
  color: #fff !important;
  transform: scale(1.1);
}
/* ===== Botones de donación: Binance, USDT, Ko-fi ===== */
.donate-buttons a {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.8rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  cursor: pointer;
}

/* Hover: ligero aumento y sombra */
.donate-buttons a:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  filter: brightness(1.1);
}

/* Efecto de pulsación al hacer click */
.donate-buttons a:active {
  transform: scale(0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25) inset;
  animation: pulse 0.25s ease;
}

/* Pulse animation */
@keyframes pulse {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.02); }
  100% { transform: scale(0.95); }
}

/* Colores originales de cada botón */
.donate-buttons a.binance { background-color: #fcd535; color: #000; }
.donate-buttons a.usdt    { background-color: #17a2b8; color: #fff; }
.donate-buttons a.kofi    { background-color: #29abe0; color: #fff; }

/*Espacios para icones en botones*/
.btns button i {
  margin-right: 6px; /* espacio entre icono y texto */
  vertical-align: middle;
}

  .descargo {
    font-size: 0.9rem;
    color: #555; /* color normal */
    text-align: center;
    margin-top: 20px;
  }

  @media (prefers-color-scheme: dark) {
    .descargo {
      color: #555; /* color para modo oscuro */
    }
  }
  
/* HEADER */ 
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #ffffffee;
  border-radius: 12px;
  max-width: 900px;
  margin: 15px auto;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  position: relative;
  z-index: 10;
}

/* LOGO SEPARADO */
.logo-container {
  background: #343a40; /* ← nuevo color verde llamativo */
  padding: 8px 15px;
  border-radius: 10px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.logo-container:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.logo-img {
  display: block;
  height: 40px;
  width: auto;
}

/* NAV */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: #007bff;
  font-weight: 500;
  position: relative;
  display: inline-block;
  padding: 5px 10px;
  transition: all 0.3s;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.main-nav a:hover {
  color: #0056b3;
  transform: translateY(-2px) scale(1.05);
}

/* BOTÓN HAMBURGUESA */
.menu-toggle {
  display: none;
  cursor: pointer;
  width: 30px;
  height: 25px;
  position: relative;
}

.menu-toggle span {
  position: absolute;
  height: 3px;
  width: 100%;
  background: #007bff;
  left: 0;
  transition: all 0.3s;
}

.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 11px; }
.menu-toggle span:nth-child(3) { top: 22px; }

.menu-toggle.active span:nth-child(1) { transform: rotate(45deg); top: 11px; }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg); top: 11px; }

/* MÓVIL */
@media (max-width: 768px) {
  .site-header {
    gap: 15px; /* ← SEPARA el logo de la hamburguesa */
  }

  .menu-toggle { display: block; }

  .main-nav ul {
    flex-direction: column;
    display: none;
    position: absolute;
    top: 65px;
    left: 0;
    width: 100%;
    background: #ffffffee;
    padding: 15px 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  }
  .main-nav ul.show { display: flex; }
  .main-nav li { text-align: center; padding: 10px 0; }
}

</style>