* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  /* Fondo elegante, limpio, premium */
  background-color: #f4f7f6;
  background-image: radial-gradient(circle at top right, #e2e8f0, transparent 40%),
                    radial-gradient(circle at bottom left, #e2e8f0, transparent 40%);
  display: flex;
  flex-direction: column; 
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  color: #333;
}

.header-logo {
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 1rem;
}

.header-logo img {
  width: 100%;
  max-width: 500px;
  height: auto;
  filter: drop-shadow(0px 8px 15px rgba(0,0,0,0.08));
  transition: transform 0.3s ease;
}

.container {
  display: flex;
  flex-direction: row;
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  max-width: 1100px;
  width: 100%;
  gap: 2.5rem;
}

.formulario {
  flex: 1.2;
}

.formulario h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  margin-top: 0;
  color: #1a202c;
  font-weight: 700;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #edf2f7;
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: none;
  border: none;
  padding: 0.8rem 1.2rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #718096;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #f7fafc;
  color: #4a5568;
}

.tab-btn.active {
  background: #ebf4ff;
  color: #3182ce;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

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

/* Campos */
.campo {
  margin-bottom: 1.2rem;
}

.campo label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #4a5568;
  font-size: 0.9rem;
}

.campo input[type="text"],
.campo input[type="url"],
.campo input[type="email"],
.campo select {
  width: 100%;
  padding: 0.9rem;
  font-size: 0.95rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  background: #f8fafc;
}

.campo input:focus,
.campo select:focus {
  border-color: #3182ce;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
  outline: none;
}

.campo small {
  display: block;
  margin-top: 0.4rem;
  color: #718096;
  font-size: 0.8rem;
}

.campo input[type="file"] {
  width: 100%;
  padding: 0.8rem;
  font-size: 0.9rem;
  border: 1.5px dashed #cbd5e0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
}

/* Sección de Diseño */
.design-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #edf2f7;
}

.design-section h3 {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: #2d3748;
}

.estilos-qr {
  display: flex;
  gap: 1rem;
}

.campo-mitad {
  flex: 1;
}

.colores {
  display: flex;
  gap: 12px;
  margin-top: 0.5rem;
}

.color-option {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.color-option input { display: none; }
.color-option:hover { transform: scale(1.1); }

.color-option:has(input:checked) {
  transform: scale(1.2);
  box-shadow: 0 0 0 3px #3182ce;
}

/* Botones */
.acciones {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

.btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-success { background-color: #2b6cb0; color: white; flex: 2; }
.btn-secondary { background-color: #e2e8f0; color: #4a5568; flex: 1; }

.btn:hover:not(:disabled) {
  background-color: #2c5282;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(43, 108, 176, 0.2);
}

.btn:disabled {
  background-color: #cbd5e0;
  color: #a0aec0;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Preview */
.preview {
  flex: 0.8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-radius: 20px;
  padding: 2rem;
}

.phone-frame {
  width: 300px;
  height: 580px;
  border: 14px solid #1a202c;
  border-radius: 40px;
  background: white;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0,0,0,0.1);
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 6px;
  background: #cbd5e0;
  border-radius: 10px;
}

.qr-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

#qrcode {
  width: 190px;
  height: 190px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.3s ease;
  margin: 0 auto;
}

#qrcode canvas, #qrcode svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-container p {
  margin-top: 2rem;
  font-weight: 700;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9rem;
}

/* Responsivo para móviles */
@media (max-width: 850px) {
  .container {
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .estilos-qr {
    flex-direction: column;
  }

  .tabs {
    padding-bottom: 0.5rem;
  }
}